Refactor context stuff so that backtracking applies to variables.
Refactor scanner and context into mixins; reuse scanner in interpreter.