Batch send events to reduce write calls
Tidy up error path, use utility functions for event queue and time increment, issue more clicks less often to reduce system load