Lowered the CPU usage.

Also task-to-task event handlers are used now instead of just one task looping and hogging the whole thread.