Add beforeFind event to ORM\Table.

Keep things simple and add a very basic event for beforeFind. In the
future the updated behaviors will be able to use this event.

I've decided to solve a long standing problem and make it super simple
to replace the result of a find() entirely. Stopping the event and
setting a return will circumvent the entire find and return the provided
value. This makes it really easy to replace find actions with cache
results for example.
Simplify constructor logic.

Chaining through multiple objects makes mocking and testing harder.
Moving method calls out of the constructor makes the ResultSet simpler to
work with. This will be more important as serialize features are
implemented.
Add setResult() to Query.

This will allow beforeFind() callbacks to avoid query execution by
setting seeding results.
Make Query take required arguments in its constructor.

Calling the repository() method was not optional. Since the dependency
is required it makes the most sense as a constructor argument.
Rename properties

counter and count were confusing and the new names fit the actual use
better I think.
Make ResultSet buffer the statement results.

This will allow it to more easily implement serializable interface,
which will be important for caching results.
Add rewind() support to ResultSet objects.

By buffering the results a ResultSet object can be rewound and re-used.
This will also help implement caching as PDOStatements cannot be
serialized.

There is now some duplication of buffering logic between ResultSet
and BufferedStatement. That will need to be solved later.
Make ResultSets serializable.

By implementing Serializable, ResultSets can be persisted into
a persistent cache like Memcache. Unserializing needs only to set the
results again as other properties are set to their defaults.
Add support for JsonSerializable.

Fix issues with deserializing ResultSets, where a `false` would be
appended to the stored results.
Update test to better illustrate how setResult() + beforeFind work.

Remove the type hint on ORM\Query::setResult() as it makes life harder
not easier. If people want to blow their foot off with incorrect types
they can go for it.
Always return a Query instance from find()

Even when the beforeFind event prevents the find a Query instance should
be returned. This will allow developers to chain query features without
worrying about callbacks blowing things up.
Fix test assertion order.
Merge pull request #1462 from cakephp/3.0-beforefind

3.0 beforefind