term rewriting and sesqui-categories