First Integrals, Liouville Theorem, and Dirac Brackets