rename internal id to index, add tests
Merge pull request #18 from mapbox/type_index

Rename internal id to index, add tests