Refactor serial_task

Added handling for role lambdas and rewrote the slice-building logic to
use ruby idioms.

There was also an issue with getting roles from the wrong namespace
(self.roles vs top.roles) in allow_optional_tasks and serial_task (line
94). Fixing this resolves #279
Merge pull request #280 from rubber/refactor_serial_task

Refactor serial_task