Make tokenization idempotent
Make tokenization idempotent

Previously we mutated an instance variable in tokenization. This was
bad for encapsulation, because individual functions changed the state
of the class, which requires the reader of the code to read everything
to figure out where state can change. It also made the tokenization
not idempotent, since tokenizing input once was different from
tokenizing many times given the same instance of the class. The new
behavior of tokenization is idempotent, so it should be more
predictable for users of the class. Also, I duped and froze the input
string so that you can tell it doesn't change when the class runs.

stackbuilders/simple_templates