Improved db, core, log and term modules