Hierarchical Distribution Matching: a Versatile Tool for Probabilistic Shaping