MRG: preserve branch ordering in conversion to csv and in TreeBuffer

This also adds ordereddict to extern from https://pypi.python.org/pypi/ordereddict.