On the Hamiltonian structure of large deviations in stochastic hybrid systems. (23rd March 2017)