Cleanup of scanner.

Removed redundancy of keyword definitions and removed some unused token
predicates.