Add QueryResultSelection hooks

Relates to #555

- `SMW::Store::selectQueryResultBefore` can be used to implement a QueryCache
- `SMW::Store::selectQueryResultAfter` can be used to implement a UsageTracker