Begin refactoring database
Please note none of the pending changes will take effect yet,
I'm writing a new file and when it's ready I'll overwrite the current database.js