Use `text` function inside actions

 * Prefer the pegjs API over manually calling,
	input.substring(peg$reportedPos, peg$currPos);

Change-Id: I35d550f6489e1d4a15343c4d38dfc11b77798336
Minor cleanup in tokenizer

Change-Id: I1d0e4a3c4f84c01aa46e6e47f25554317ae8cc17