Start improving parser syntax checking.
Replace parser error checks with exceptions.
Tidy parser. Fix mishandling of '}' in strings.

Parser was treating a closing brace inside a string as the end of an
entity block, causing data to be truncated. Only occurs for the first
entity block though.
Move tokenizer into new file.
Build fix - included wrong header.