Make task state a enum.