Add a basic scheduler.

Fix #9