add script to build equivalence classes

scratch/build_equivalence.py and scratch/survey.py allow you to produce
a flat version of the categories dataset:
- easier category lookup and traversal
- counts have been corrected
- singletons removed
- equivalence classes identified

Also produces a categories_tree.json file for visual browsing in any
software that parses json into a navigable structure, such as
shpow.com/reports2html.