safety sync, work in progress
safety sync
documentation, continued refactoring of render.py and improved unit tests
sync
Render: Ensure lists are sorted by key

Although maps are already sorted by key as part of the JSON
serialization, lists contianing a field that acts as a key (e.g.
"index") were not sorted. As a result, the HAL object returned from
_hal() would have an arbitrary ordering that depended on the internal
representation of the originating map, which would often differ from run
to run. As a result, test_a03 would usually fail, since the expected
result had embedded objects appearing in a different order to that in
which they were expected.

We now do a sort on the embedded objects as well as the key list before
returning the object, to ensure the same result is returned every time.
Response decoding problem
Revert previous commit (debug statements only)
Remove old_render.py
Move JSON encoding into hyperdns-hal renderer

Previously when encoding an object into a JSON string, we would first
call the _hal() method of the object, which would produce a Python
dictionary containing all the properties, embedded resources, and links,
in a form ready for serialisation. The subsequent encoding of that
dictionary into a JSON string would then occur outside of the module -
specifically in hyperdns-flask's result.py, using EnhancedJSONEncoder.

With this commit, the JSON encoding step has now been moved into
hyperdns-hal's render.py module. Thus, libraries which use hyperdns-hal
no longer need to concern themselves with the JSON encoding step, at
least in the case of calling _hal() on an object, since that now returns
a string.

Internally within render.py, the two steps are still performed as
before, but what used to be called _hal() is now _hal_raw(). This allows
the recursion through the object tree to still be performed without the
need for string concatenation; the resulting dictionary is simply
converted to a JSON string all in one go at the end.

As part of this change, the EnhancedJSONEncoder class has now been moved
into render.py. It is still used for other purposes in result.py, and is
thus imported there.
Test cases for _hal returning string

The previouly-existing test file, test_a00_sanity.py, is now called
test_a00_raw.py, and contains tests for _hal_raw(), which returns Python
objects. The new file, test_a00_string.py, tests _hal(), which returns
strings.
merge of patchup into develop