Adding unit and integration tests for json serialization

This depends on the pending HtmlTags pull request.