Adding the index argument to the function argument in populateMap

Also adding tests (there should've been tests...)
Type change.  Whoops
Adding empty case
Merge pull request #1133 from palantir/populateMapIndex

Adding the index argument to the function argument in populateMap