Added argument checks for indexes

Attempting to use `null` as an argument will now throw an
IllegalArgumentException rather than a NullPointerException later

fixes #242
Merge pull request #243 from basho/gh242-index-null-pointer

Added argument checks for indexes