Added spaces to key values, R script changes

Changed everything to support spaces in keys and values. Massive
updates to the R script.