libcore: handle trailing newlines more like other languages.

Specifically, `lines` and `each_line` will not emit a trailing empty string
when given "...\n". Also, add `read_lines`, which just collects all of
`each_line` into a vector, and `split_*_no_trailing` which will is the
generalised version of `lines`.
compiletest: Use lines_each instead of lines(..).each, or split(.., n).each