Added some documentation and cleaned up the R hashbang script.