Move test, add trimEachLine() util function