Added comparator to NamedEvent

Tests, too.