Refactored the database classes, and added a class with user oriented sql queries
Refactored some of the view classes, made the names more consistent, and simplified some code