move monoid def into types
some tests for rws