Clean up test cases
Convert database manager to a singleton
Clean up code