Preserve knowledge about notegroup membership and use it to generate beaming for LilyPond.

This turned out to be easier then anticipated.