[#4270] Force inherited classes to load into the correct environment
Parent classes were getting searched for in a way that fails if they
were not already loaded into an environment. This patch replaces that
codepath with a call that will load them if they are needed.
This bug was masked by another bug that loads all classes into
"production", whether they are used there or not.