Moving the E2 chaos-region code into a separate module