Fixed issue #30

Added an extra conditional to prevent using MockProvider if it's an inner class, and added a test to verify that the new version works correctly. This fixes issue #30
Hmm, there isn't a contributors section. Shall I create one? I know that there are other people who've contributed to this project, my last pull request was cleaned up by Maxime but I don't see her in the pom