Add index WriteTreeTo + test
Merge pull request #71 from jezell/add-index-write-tree-to

Add index WriteTreeTo + test