added support for working directly with the _id from a group field.
added initial support for caching query plans.