No longer insert loader for cached scripts if a loader has already been inserted. Adds test case.