Add "debug" argument for straightforward debugger

I found it really difficult to debug tests with Karma and PhantomJS, and I saw others struggling too so I modified the code to make it easier. There may be better ways to do this but it worked for me and everything else seems really brittle.