Added callback for checking whether tasks should be sent to scheduler.

This is used to prevent new tasks being sent when battery is low.

Also made task_routine killable further.
Merge pull request #43 from hawesie/hydro-devel

Added callback for checking whether tasks should be sent to scheduler.