Set topLevelEnvironment option when running user code

Function copied from testthat

Fixes gh-33 (hopefully)