Separate compiler parts

This should expose the surface needed to do rule processing in advance of using a DFA to transition between states.

DO NOT MERGE.

Looks like this needs discussion now that the raw JavaScript feature is a thing.

I started this by refactoring the rule emission to emit a single blob of rules -- this is nice from a further processing perspective, so that the rules can be refined without textual JavaScript mixed in.

Is there a use-case for having JavaScript dropped in wherever, other than at the head or foot?

Thoughts in general?