All basic tests passing

Made it easy by assuming that all commands are sent in blocks, so
there's always a response object sent, on which we can listen for the
`'generr'` event, which means that `generator.py` threw an error. Also,
we know when the response has ended, thus we know when we should check
for the error. Look at the function `makeDest` in `generatorTest.js` for
more information on the events that signify changes.

Also added a simple `DEBUG` constant to `generator.js` that can be used
to toggle the console debug output.