Index sets

Fixes #42.