Clean up into tests, and simplified creation of monoids.