Implements an external records stack to prevent repetitions

- External records (from external reference and texture palette
function calls) are now saved in the parent class. This prevents
opening a file repeated times and consuming excessive amounts of
memory. The external reference and texture palette functions have been
modified to store records in the parent class.
- External records use a dictionary object whose key is the filename.