Add option 'limit' to limit the number of items that can be selected

In multiple mode, use this option to limit the number of items that can be selected at the same time.

Quite possibly a fairly naïve approach. The tests also aren't optimal, but I haven't found a better way to test them without touching more code. At least it is a suggestion. :-)

This addresses #178.