Advances in the Theory of Fixed-time Stability with Applications in Constrained Control and Optimization