Text this: Gait and Trajectory Optimization by Self-Learning for Quadrupedal Robots with an Active Back Joint