Test module closures

The last commit of this branch provides a test to address GPRESOURCES-177. Matt Hurne's pull request #29 provides the fix so that this test doesn't fail.