Fix #59: reset connection when connecting.

If buildConnection() is called before connecting, rather than after
disconnecting, then we don't get errors for trying to reconnect while waiting.
Also, it makes more sense.

This patch also removes the unused resumeConnection(). Future versions may
eventually implement a way to reuse a connection if the page is reloaded within
the 60-second timeout.