fixed database bugs
Shifted dependancy from concrete class database to database interface
merge