Cleanup event handlers in two phases - before close and after close
Bump version to 2.3.1