Added level up event handling.

Fixed some stuff in xp event handling, some tests are needed.