Learning Task-Relevant State Spaces with a Utile Distinction Test