Removed forgotten includes.
Added events
Implement event handler/loop.
Remove unnecessary casts.

return -1, instead of exit()ing if we fail to get memory.
Removed annoying and unnecessary output.
add events_cleanup(). Now update game tick speed.

Few logical changes.
variable renames, made timerid value global to file and reduced number of
possible events from 4 to 2.
Version bump.