Moved lib/database in Node.js context
Replaced Main.init with anonymous function to get rid of Main