Eventually got the concept for waitqueues

- Implemented waitqueues. One per event type. When a task is
  blocked on an event queue and the event triggers the task is
  runnable and removed from all the waitqueue it registered with.
- The assembly code is awful and when debugging the PC jumps
  at address 0x100 which is not part of the compiled code!!!
- The ISR timer0 routine takes up almost 256 cycles....

We definitely cannot use such approach for near real-time code...