Magnetohydrodynamics of Gamma-Ray Burst Outflows