Optimization-Based Planning And Control For Robust And Dexterous Locomotion And Manipulation Through Contact