The Hamiltonization of Nonholonomic Systems and its Applications