Toggle running

Implement #1368 , see commit messages for details