Optimised Context::substitute().

Constructing the variable name character by character was unnecessarily slow. We now use the new InternedString range constructor to construct without needing any temporary allocation at all - this gives us a 65% reduction in runtime for a simple test containing two substitutions. Even when the new constructor isn't available, we get a 50% reduction in runtime, presumably because we now have only a single temporary allocation whereas before our use of push_back was causing multiple allocations.
Added '\' as an escape character in Context::substitute().

Fixes #997.
Optimised Context::substitute().

Using a switch rather than a series of if()s gives a further 40% reduction in runtime for testManySubstitutions().
Merge pull request #998 from johnhaddon/substitutionEscaping

Substitution escaping