Add tree map/reduce

See #22