This should implement the perpetual restart mechanism described in the issue, but it should definately be looked over first.