Added base for events system. Needs to be tested.