adding more caching functionaility
improved caching system. Now uses a class that loads the file or builds it from the closure