Compensations refactor

This requires a fix to Narayana and WildFly before it can be merged.