Extracted common helper functions

Also renamed tests to have more succinct names, and separated the
meaning of ‘event’ and ‘value’

Event refers to all events: success, error, next
Value refers to next events only
haveIdenticalErrors + tests