Support building group.js on the fly

This works in this branch but I did not test sufficiently to merge it
in the master. I should try removing all group.js and regenerating.
Not sure it will work. There is a similar branch in pillow and both
branches are in a semi-finished state.

WARNING WARNING WARNING: The changes to testviewer are WRONG!!!! must be removed.