Allow JSON to be passed as STDIN

Change-Id: If55c0fee7c3f9a09ad9a70b3e1a9741b0cf0ba48