Basic Caching and Consistency

Added support for the caching service. The only built-in driver at the
moment is ArrayCache - this is just a registry, and it doesn’t persist
between requests.

Some classes have been tidied up for consistency.