added better support for checking other modules
Removed useless istype function, and updated tests
rearranged functions to put Base extensions at the top.
Rearranged functions. Added/edited/removed comments.