Week 4 .cache
Implement Part 1 and 2

Implements tree encoding and construction.
There appears to be a problem with the creation of the a-h tree from the
example page, but the decoding suggests that the test is correct, the
implementation is wrong.
Fix up tree example
Basic encode

Fills in Part 4a