Made events system thread safe.
Fixed error code when events heap is full.
Updated TODO list.