F/rewrite groupset

Added groupset rewrite object and added tests for rewrite functionality.
this two lines should probably be extracted as a helper function in logmsg