Voltage imaging and optogenetics reveal behaviour-dependent changes in hippocampal dynamics