Big refactor

This re-thinks the interface quite a bit and introduces the core
generator mechanism. Things should settle down at this point and
new features can be added more easily.