Allow complex objects within a doc to be used as script param

Reuse the unpacking/json-ification of complex objects
relates #223