-Change: try to be aware of django 1.7's new Apps system.

This should fix the problem found in #1015

I split off the get_models to out of the class; when django.apps can be loaded (as per 1.7), we use the apps variant, if not, we use the version that was already in place (which was only moved out of scope).

Due to this, is_app_or_model also had to move.