A finite-depth unfied theory for the linear and second-order problems of slender ships