Refactor linear_stretch.R and add tests.