Invalidate the timer *before* the callback

This allows us to reuse the timer ID within the callback if needed
Malloc the timer size (maximum number of events)
Create robust constructor, refactor event malloc code
Make event initialization the responsibility of the Event class