Support 'rich' json objects as script parameters

Allow non-values to be passed as scripts. unfortunately the data needs
to be re-parsed and written back as, due to encoding, there is no
reliable way to copy the byte array directly

Fix #277