passing the database handler as argument to engine.js
lots of fixes in files to get things up and running.