Encode & in JSON encoded attributes.

This fixes the SyntaxErrors in #1732.
Merge pull request #1733 from dantman/fix-json-attribute-entity-encoding

Encode & in JSON encoded attributes.