A Newton's method solver for the two-dimensional and axisymmetric Navier-Stokes equations