Refactor TaskResult for safer coding

Triggered by https://github.com/Thomvis/BrightFutures/pull/2, I reimplemented the TaskResult enum to be able to get rid of forced unwrapping everywhere