TemplateRegionParser properly handles when scala code overlaps 2+ doc regions.

Certain characters (such as '&' and '<') when part of scala code would cause the XML parser to become "confused" and generated "UNDEFINED" document regions that appear in the middle of the scala code. This would in turn cause the code to not be properly highlighted since the TemplateRegionParser specifically wouldn't handle that scenario.. Now it does!

Fixes #167
New Template Editor now properly highlights @ and { of "reusable code blocks"

A leading { or @ in t "reusable code blocks" weren't properly syntax highlighted because the TemplateRegionParser wasn't looking for the magic at and template braces in default partitions that have the "=" character in it. This fix does a pass over those tokens and splits them into two distinct tokens (one with the '=' and the other with either the '@' or the '{').

Fixes #168
TemplateRegionParser refactoring for better maintability. Tests for #167/#168

The refactoring includes a number of changes:

* Avoids unneeded collections conversions
* Move common functionality into helper classes
* Removed a lot of immutability and imperative code in favour of pure/functional code where it made sense.
* Got rid of the LazyCache class (the old behavior is now emulated by
  creating a new instance of `TemplateRegionsComputer` when calling
  `TemplateRegionParser.reset`).
* Cleaned up several of the methods in the PartitionHelper class.
* A few other small things here and there.

There are now three new TemplateRegionParser tests that cover #167 and #168
Merge pull request #171 from jhaberstro/spanned-xml-doc-regions-and-syntax-highlight-fixes-#167-#168

Multiple spanned XML doc regions and "reusable code blocks" syntax highlighting fixes.