Modified code to allow caching, added module for loading from a referenc...

...e model