Refactor executor

Move Task and Result from Executor to Pipeline. Fix import loop.