minor fixes
db queries done => ready event
system module to hold global settings/state
switching to abstracted db, cleanup