Refactored Database and Settings to be singletons because Java.

Started reworking Database into something more sensible.