Add docs, minor tweaks.
Code from wiki-tools-lucene, commit 5607a89a275755ec4a19dd71d107ba72c13b2e4b, refactored.