Add Query::bufferResults()

This method changes the ResultSet into a BufferedResultSet. Using
buffered result sets allows you to re-use a result set and more easily
cache + iterate results.
Extract BufferedResultSet.

During discussion on github, it became apparent that buffering results
by default is not a good idea. Split the buffering out into a subclass
that is optionally enabled using Query::bufferResults().

Do some refactoring in ResultSet to make fewer method calls and less
code overall.
Merge pull request #1494 from markstory/3.0-bufferresults

3.0 Add Query::bufferResults()