Fixing issue #291 (WIP)

`beforeunload` is unique, in that you have to follow exactly what it wants for the function's return.  If you return a string, it blocks, if you return anything else, it lets the close happen.  Read the docs I gave you.  You want something like:

```js
function windowCloseWarning() {
  if(sync.state === sync.SYNC_SYNCING) {
    return 'Sync currently underway, are you sure you want to close?';
  }
}

global.addEventListener('beforeunload', windowCloseWarning);
```