Implements FORGE-1102 - Facet dependencies should be registered in correct order, and optional dependencies should be respected.