Moved database handling to separated class.
Moved DatabaseManager to different class, code cleanup