Added error handling to the module loader
test cleanup
Merge pull request #517 from filipw/516

Error handling in module loader