Re-wrote enumerate_modules resolving Issue #209

Re-wrote this entire method, it's still rather messy but it fixes Issue #209 and covers a few more cases than before such as white-listing extra modules correctly.