Output number of DB queries

See #11.
Please ignore the merge commits, I couldn't get rid of them in the pull request.