Improve secondary index creation logic

- Make sure that all primary keys from the underlying table are included in
  the index primary key, so that multiple index entries per indexed value are
  supported.

- Fix a minor JSHint warning
Rename restrictions set to the more general 'tags'
Tweak docs on secondary index access use case