Set topLevelEnvironment option when running user code

Function copied from testthat

Fixes gh-33 (hopefully)
Merge pull request #43 from takluyver/i33

Set topLevelEnvironment option when running user code