Refactoring; moving newton and linsolve into terra-utils.