Revert "Merge pull request #4633 from thestinger/treemap"

I was too hasty in merging -- this needs a snapshot.

This reverts commit 4a7e1ab3745f519536ef6e0377427fc41e47f7c6, reversing
changes made to e447521c1ca2dbead5b485ddc43060b282840817.
cleanup, refactoring