more function comments
Add flexible support for multiple header groups.

The biggest change is to now use one common file for all typedefs
and enums. Various functions have been reorganized to support this.