Smooth as butter, generator.js/.py working.

Fixed the bugs. Am using a single stderr and stdout listener, this works
much better.

There's now an internal array of promises in generator.js, that's either
entirely rejected on stderr, or message type is matched on stdout.

Edited spec to work and included more test cases.

Generator.py message receiving is much more robust: if it doesn't find a
'{' as first character, it tries to extract JSON looking for the first
and last '{' and '}'.

Re-organised generator.py, much more readable now. I like a 'utility
functions' section.