merge in db setup changes

That @stevenolen poorly made on master, not on ohmage-2.16 branch.