Some code-stylistic improvements to rexit library; also moved exit_trouble() into it.