Moved category::getTotalPhotoCount() to new db class

Also added code to add an array of parameters to a query. This useful
for, for example an WHERE ... IN (..., ..., ...) query.

Issue #20
Refactor Querybuilder code

Refactored some of the code from last commit for cleaner code.

Issue #20
Added swap files to gitignore
Added LIMIT and ORDER BY functionality to Querybuilder

Including unittests

Issue #20
Change category::getAutoCover() to new db

- Also created a new getAutoCoverOrder() function, that for now exists
besides the old one, until all classes have moved to the new db.

Issue #20
Added GROUP BY clause to querybuilder

Issue #20
Changed category::getDetails() to new db core

Also moved the generation of JOIN queries to restrict a query to only
the photos the currently logged in user is allowed to see into a
separate function.

Issue #20
Changed category::getByName() to new db

Issue #20
Moved category::getChildren() to new db

This partly fixes #58 (same change should be made for albums)
Issue #20
Split query class into select and query to allow for other types of queries

Also refactored a bit to make things simpler and remove unused functions

Issue #20