Added interface WritableTree for tree-like objects that can be written
out as trees.

Signed-off-by: Jakob Brandsborg Ehmsen <jakobehmsen.github@gmail.com>