Cleanup various selection-related problems

Contains fixes for issue #161, #165 & #123.

This patch also allows word and paragraph expansion to occur on mouse-down, rather than waiting for mouse up.