Sort enums and functions (in their categories).

Enums are only sorted in the Haskell template. Functions are sorted for
everyone.

The idea is that files generated by flextGL don't cause noise in diffs when
they are checked in to source repositories. Python dictionaries are hash-based
and the hash is random for each invocation which means all the functions and
enums are scrambled whenever generated.