Changed DatabaseManager to a singleton, added some documentation.