Add closure detection WiP

Despite having created a much smaller test I'm still seeing this error on the tests:

![1__bash](https://cloud.githubusercontent.com/assets/1514/5494713/fbaccec8-86ee-11e4-8203-77256aeac320.png)

Running the test on its own passes.

@kumar303 any thoughts on what might be causing it?
You could add a closer-to-real-life test by doing what [this test does](https://github.com/muffinresearch/fxpay/blob/filthy-close-detection/tests/test-web-purchase.js#L68). It calls ``simulatePostMessage()`` to call the event handler which would trigger the window closing code.