Prioritized Optimization for Task-Space Control