Added a NonlinearLS type and methods for it.