Update main.js to allow querying the word at current cursor position, even when not selected.

When no text is selected the word at the current cursor position will be selected. This way there is no need anymore to select the word to search for, simply putting the cursor somewhere in the word is sufficient.