add `type` field to be returned from `.json()`

Adds the facade .type to the json payload so we don't have to do
it manually. Sets .json() to better match the spec

@yields @lancejpollard