Save a bunch of is_string() calls by ensuring proper input to peek()
Optimize consumeUntil()