Add the ability to mock modules

This pull request adds in a feature to allow easy mocking of modules. I've included unit tests and a documentation update that shows how this feature is used.