FIX: move the resource state tracking to TaskResourceManager, and enforce the requirement of any MODIFICATIONS of a Task[Resource] instance to be owned by the TaskGraph instance (Reading from outside the instance is allowed, as long as no state has been made unpure, e.g. due to UseImage()).