changes to move to jsonlite from rjson libraries, and other fixes for formula gernation