Fix exception throwing with tests for fail cases

Fixes #12
Closes gh-14
No travis notifications
Merge branch 'master' of https://github.com/mrjoelkemp/module-definition