Distinguish empty input from unexpected tokens
Refactor: nextValue() -> valueOf()
This replaces the mixed-mode behaviour of nextValue() - if given a token,
it would use that, otherwise use nextToken() to fetch the next one. By
making the first the only behaviour, added a small performance gain.
Renamed the method to be clearer what is does