Introduce a common base clase for global caching of objects
Delegate Sparsity caching to the Cached base class
Call _process_args before passing arguments to _cache_key or constructor
_initialized flag to guard against multiple __init__ calls

Classes derived from Cached need to set a flag indicating whether the
constructor has already been called and immediately return from
__init__ if the flag is set. Not doing this causes the object to be
re-initialized even if it was returned from cache!
Delegate ParLoop caching to Cached base class
Remove helper functions _empty_parloop_cache, _parloop_cache_size
Only cache generated ParLoop stub in JITModule class
Returning None for _cache_key means don't store in cache
Delegate _GenericPlan caching to Cached base class
Remove helper functions _empty_plan_cache and _plan_cache_size
Cache kernels to avoid running C preprocessor multiple times
Add kernel caching unit tests
Minor refactoring of host.JITModule for consistency
Documentation updates and clarifying comments
Merge pull request #173 from OP2/kernel-cache

Cache kernels

When a new Kernel is constructed we call the C preprocessor on the code
i.e. we spawn a subprocess. To avoid doing the expensive operation again
unnecessarily we cache kernel objects with an md5 hash of the code and
the function name as the key.

To avoid code duplication, a common base class for cached objects is
introduced, which expects derived classes to override the class method
_cache_key and optionally _process_args if arguments should be sanitized
before calling __init__. This base class is used for Sparsity and
Kernel. To cache the generated stubs for ParLoop objects, the code
generation and JIT compilation for all backends is factored out to a new
class JITModule, which is cached.