Updated R script to handle more complex requests

Also tweaked csvToPyam.py so that if given a field labeled "meta" all future fields are considered to be metadata.