One of the pain points in Wikidata was that originally the JSON we used to expose the entities was the same as the one used for storage. This didn't allow us to change the internal representation easily. Another thing is that we couldn't do things like a Z0 for referring to itself.
Add a function that takes an internal representation and modifies it for external consumption. The only difference for now is that we replace every Z0 which is not the value of a Z6K1 with the page title.