Improved template parsing error handling.

For an example of what can trigger it:

  template<typename _CharT, typename _Traits = char_traits<_CharT>,
           typename _Alloc = allocator<_CharT> >
    class basic_string;

  extern template class basic_string<char>;

Signed-off-by: Elias Holzer <elias@vvvv.org>
Applied "Improved template parsing error handling" to old parser.
Removed redundant code.
Increased the initial capacity of the used SmallString when generating a USR.