BV functions and sets of finite perimeter in sub-Riemannian manifolds