Energetic Efficiency And Stability In Bipedal Locomotion: 3D Walking And Energy-Optimal Perturbation Rejection