Optimization-based Motion Generation and Control for the Humanoid Robot H1