Categorical cleanup

Make categorical a little more user-friendly and add some documentation.