added categorize_by_function script

While writing this script, I discovered a bug in the ``to_csmat`` and ``to_sparsemat`` code for BIOM. The bug is fixed in biom-format/biom-format#95 through a few pulls, but obviously that requires partial dependence on BIOM dev. This works just fine though for ``DenseTable`` though.