Add support for json output, improve EXAMPLE.lua.Signed-off-by: Ross Allan <[email protected]> (commit: bc9df61)