Shaping swimmers and their environments for better locomotion