Present entity references through a map.

This changes any entity references to not present the data as a regular
string. Instead any entity reference is presented as a map, with one
entry named "$eid".
This allows clients to know what values are references to other
entities, and act upon that. This wasn't possible previously when a
simple string was used instead.
Note that those properties that implicitly refer to other entities, i.e.
"contains" and "loc" still use strings. This is because these are known
by the entity as entity referring entities.
Adjust entity references in attributes.

This is possible through the new entity ref format, where an entity ref
is specified through a map with an "$eid" entry.
Delay sending attributes with entity references.

Only send Set operations which update those attributes once all entities
have been properly created on the server, and we know their ids.
This, together with other $eid fixes in cyexport, fixes the issue with
wielded and worn entities not properly being restored.