Non-holonomic Lagrangian and Hamiltonian Mechanics: an intrinsic approach