Menually load methods and utils packages in roxy script.

See http://stackoverflow.com/questions/8964515/cannot-call-roxygenize-function-from-rscript-batch-file for explanation
Test for whether the user is in Rstudio before trying to use manipulate().
A g.test() code from http://www.psych.ualberta.ca/~phurd/cruft/g.test.r to avoid timing out.