Spot/reconnect

copied from https://github.com/twosigma/beaker-notebook/pull/950

i found that after being disconnected i couldn't get the notebook back to its original state, it still said i was offline, but i could evaluate cells, though sometimes i had to cancel an evaluation and then retry.

so needs more work IMO but a step in the right direction.