Discrete rearranging disordered patterns, part II: 2D plasticity, elasticity and flow of a foam