Added DatabaseManager and other cleanups