Add query logging.

Three new options added
- dbms.querylog.enabled, if true log queries, defaults to false
- dbms.querylog.filename, the file where queries are logged, defaults to `queries.log`
- dbms.querylog.threshold, only log queries that run slower than threshold (in milliseconds)
  defaults to 0, i.e. log all queries.