Add WordIndex and tests