Cleaned up the logic around classloading

I found this area kind of confusing when I first encountered it.  So, I spent sometime refactoring it.  Less code, more comments.  I figured I should have someone else look at to make sure I wasn't making it clearer to me but less clear to everyone else.