Abstracted creation of json object from strings and moved into shared library.