cleaned up CreateIndex and added Tests
Merge pull request #37 from timbokopter/feature/cleanup_CreateIndex

cleaned up CreateIndex and added Tests