Add query logging.

Three new options added
- log_queries, if true log queries, defaults to false
- log_queries_filename, the file where queries are logged, defaults to `queries.log`
- log_queries_threshold, only log queries that run slower than threshold (in milliseconds)
  defaults to 0, i.e. log all queries.
ok, but what happens if you call <code>endSuccess(session)</code> several times? By calling <code>hasNext</code> multiple times or by calling first <code>hasNext</code> and then <code>close</code>? 

From my point of view I would say that calling <code>endSuccess(session)</code>  only in <code>close()</code> should do the job, am I wrong?