splitAt = (text, pos, getFirst) => {
      if (pos < 0) pos = text.length + pos;

      if (getFirst) {
        return text.substring(0, pos);
      } else {
        return text.substring(pos);
      }
    }
Split a string at the given location, return either first or last part

Allows negative indexing, counting from back (ruby style)
@param text
@param pos
@param getFirst