Performance optimizations.

- Do not use regex for parsing
- Slightly more flexible output options
- Use plain C strings in tokenizer inner loop instead of std::string
- Use fread instead of iostreams for template loading