Pātuhitia tēnei: Hamiltonian mechanics of gauge systems