Initialize List and Nil so the XML parser does not introduce race conditions

Fixed #1001708. No test since no reproducible test case.
Correctly handle boundary conditions in the ScalaWordFinder

I reorganized and simplified the logic in the ScalaWordFinder,
and added a few tests. It seems to fix at least the exception
and a couple of other boundary conditions (revealed by pressing
F3 at the very beginning or very end of an identifier, or even
an identifier between `{}`).

Fixed #1001526
Merge pull request #442 from dragos/issue/race-condition-xml-1001708

Initialize List and Nil so the XML parser does not introduce race condit...
Merge pull request #435 from dragos/issue/SIOOB-hyperlink-1001526

Correctly handle boundary conditions in the ScalaWordFinder