Multimap fix

Fixed a bug where the empty list may be retained as a value. The bug was
triggered by adding a duplicate value and then removing it. (Thanks to
Jacob for finding the problem.) Also, I simplified this class to make it
easier to understand and maintain. Added unit tests.