Add a function for sorting by attribute values.

Improve attribute type passing to a few functions to be more consistent
with the HDK.

destroyEmpty[Point/Prims]Groups have been combined into destroyEmptyGroups
which now supports vertex groups as well.