refactoring:
- got rid of boolean flags is_idempotent and is_commutative and moved them to template parameters.
- put the *=Nat operation into the abstract semiring class