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?
It seems like this test will spawn a real window interval function, no? I'd like to avoid that. The way the other tests do it is to use ``settings.theFunction()`` so that tests can overwrite them with a spy or stub. You could introduce ``settings.window`` since we already have a few tests that swap window functions.