Added a focus history.

This is useful to avoid having to repeatedly click on windows, especially
after closing dialogues.

This change comes in three parts:
 - The implementation of UniqueStack, the data structure which underlies
   the focus history.
 - The tests for UniqueStack, which pass (a few other tests for the
   utilities are included as well, since they were previously untested).
 - The actual focus history management in ClientModelEvents.