Add support for both direct DB connection and via fh.db. Make files more modular
Fix typos and callback references