merged from protocol-3; code clean up in TextSearch class
merged from protocol-3; code clean up in TextSearch class

--HG--
branch : protocol-4

runeh/dragonfly-stp-1,runeh/dragonfly-stp-1,runeh/dragonfly-stp-1