A fast direct method of mass reconstruction for gravitational lenses