use json, and break out get-query

no functional change
add an interactive namespace