Adds an invalidate_caches() compat function which is a no-op below Python 3.3.  This works around the import caching issue on OSX reported in #820