sys: add multitasking

WIP, rebased on #1276.

Uses a vtimer to yield the current thread periodically.