Extract class refactoring

moved some methods in KWIC to two new classes to conform to the
architecture requirements.