Added SQLite support to query().

Also, cleaned up unused files in the database package.
More cleanup
Merge origin/master