Generalize generated code to handle user-defined products
Test for user-defined product monoid
Don't break binary compatibility for tuple generators

This involves some code duplication, both in the code generator and the
generated source. This should be cleaned up in the next backwards-
incompatible release.
Merge pull request #153 from bkirwi/feature/product-algebras

custom product algebras