redesigning db managers

Again, splitting class into two, refactoring into a real base class and
using some common base methods to improve naming.