Dynamics and rheology of sheared two-dimensional foam