Added a simple in-process task manager.

This allows for scheduling things easily in the daemon.