Added unit tests, wordindex