Helmholtz-Hodge decompositions in the nonlocal framework. Well-posedness analysis and applications