Db fixes

Support both direct DB connections and connections via fh.db

Make files more modular.
Deliberately left commented. This is a developer training app so handy for devs to see where console log comments were used during development for debug purposes. There are quite a few commented out console.logs in the code for this reason.