Backport get_classes refactoring

Issue #1277 correctly pointed out that Oscar's latest released version
has an issue when trying to override dashboard apps. Hopefully that is
fixed by just backporting the changes to get_classes that have happened
since.