Fix wordselect shortcut to select characters in between spaces.

Closes #1275
- Use indexOf and lastIndexOf to help determine word boundry.