Add unit tests, fix small errors on Indexes

Previously there was no assurance that an index would require selecting a value
for all keys. Now that is checked and required, forcing the user to request
only valid messages from the index.