Fixed a few issues related to caching scripts that are loaded from the
same file.
Added a test case for loading multiple scripts from one file.