Refactoring of control code.

Intended to make the GUI responsive when the presenter
and simulator are not run in separate threads.
Fixed restart after stop bug.