Merge lib/lib.js into lib/database.js