Add system test for replacing an event
Update system tests for adding and canceling events

Use macro WAITFOR to make the tests faster and more reliable.
Align function naming.