allow multi-tab coexistence, disconnect on error

* Allow multi-tab coexistence
    Generate session key for each tab
* Disconnect on error
    So we also disconnect on tab close / refresh, and we won't have multiple connections alive
* Handle some error conditions
    Better error recovery