Set R environment variables for test() and document(). Fixes #246