Modeling and Control of Shapeshifting Ferrofluidic Robots