Clean up database.js

It looks much better.