Working on back tracking, going to try monad transformers in a branch...
Added backtracking and it's beautiful.

Code generation is a list monad wrapped in a StateT for the state.