Check that selection contains only word characters

Previously isWordSelected wasn't checking that the selected text
did not contain any non-word characters causing select next to fail
if the selection was all non-word characters.

Closes #196