Gracefully handle restart before start

Hi,

I just spotted this on 24 pull requests and noticed that if you hit 'restart' before you've started the engine you get an exception (trying to call stop() on undefined).

This is just a quick PR to fix that.

Thanks,
Rowan