Reimplemented cEvent using C++11 primitives.

Fixes #1523.