Learning Flexible and Reusable Locomotion Primitives for a Microrobot