Created abstract DAO class, removed Singleton usage, fixed some bugs and style errors.