Move cascading string comparisons into a switch statement.

Cursor open should be as light weight as possible.