Count the lines in a string (e.g. newlines + 1), works with windows carriage returns or unix style newlines.