An event-based loop class which can take arbitrary numbers of intervals and callbacks