Implemented method to cache external references. Untested,
Tested and fixed external references. Improved handling of paths.