Refactor WorkflowStateSet to be immutable.