Untested changes:
- Moved implementation down one stage to _do_query, which provides
a cleaner implementation.
- Added support for the 'acceptable age' of a cached query.