code: function lineNumberOfCharacterIndex(code, idx) {
    var everythingUpUntilTheIndex = code.substring(0, idx);
    // computer science!
    return everythingUpUntilTheIndex.split("\n").length;
  }
docs: given character index idx in code, returns the 1-indexed line number