Simplified tokenization stuff, and switched to new slicing syntax.