Made generator.js, example part, added tests.

There's one big problem: apparently only in the init function the stderr listener is called back on an error, not the others.
I can't find the bug. Let's try again tomorrow.

Other than that, I added many test cases and a lot of stuff seems to work now, like parameter setting and semi-functional tessellation.