Creates an array of lines split by line breaks
@param   {Number} index optional starting index
@returns {String[]}  an array of strings
function splitLines(string, index) {
  const str = index ? string.substring(index) : string;
  return str.split(/\r\n|\r|\n/);
}