Refactor generated scanner to be more efficient.

Running benchmarks for 2 seconds on 1388 bytes (bench.dtl)...
Running erlydtl_new_scanner, hold on... ok
Running erlydtl_scanner, hold on... ok
erlydtl_new_scanner scanned   7039 times in 2.000 seconds @ 4770.6 Kbytes/sec
  min 0.000 max 0.002 avg 0.000284
erlydtl_scanner scanned   4918 times in 2.000 seconds @ 3333.1 Kbytes/sec
  min 0.000 max 0.003 avg 0.000407
Deltas
  Count     :     2121.000   43.1%
  Total time:        0.000    0.0%
  Min       :        0.000      ~%
  Max       :       -0.001  -33.3%
  Avg       :       -0.000  -30.1%
  Kbytes/s  :     1437.475   43.1%
Done.