Edited custom exception class.

Microsoft in charge of C++11 support...
Few minor changes, made events a class.

Fixed mutex stuff, added more comments, made a few more places extern
"C" when __cplusplus is defined.