Hierarchies in light sensing and dynamic interactions between ocular and extraocular sensory networks in a flatworm