Variational and extremum properties of homogeneous chemical kinetics. I. Lagrangian- and Hamiltonian-like formulations