Reorder code to make it more readable
IDESlave protocol fixes in case of error

Previously, Idris was asking for the same continuation to be deleted
twice in case of errors.
Merge pull request #1298 from david-christiansen/ide-prover

Reorder code in prover to make it more readable + solve IDESlave protocol failure on prover errors