Heavy refactoring and user list changes

Refactored the event classes and other parts heavily.
Added more comments.
Wrote initial userlist code.
Added ping system for user timeout detection + small fixes