Db fixes

Support both direct DB connections and connections via fh.db

Make files more modular.
did yo mean to leave commented, or remove completely?