Persist task status.
Added extra tests for task engine persistence.