Removed Redundant Constants
Fixed Signal Listener Bug

I'd accidentally pointed the new_db event at the openDB handler.
Creating a DB works again now.
Moved DB Management to Module

This moves the previously scattered database/storage/encryption
functions all into a single module called DB that just exports a few
public functions.  Along the way I was able to get rid of
global_state.js as an added bonus.