Geometry of nonholonomic constraints