move javascript into body for valid HTML5
... also document the json  version field