Change getLines() implementation and add tests

Using preg_match to get EOLs was kludgy and pose problems in edge cases.
Additionally, using an array for each line seemed like an overkill to
me, so I merged these flat strings.