Takes the bones of shell-split and makes it handle lots of situations
without throwing exceptions, and using modern-ish typescript/javascript
stuff.
Adds lots more tests too.
Removes unneeded package dependencies.
Changes from before: escaping a pipe character `moo \\# hello` would
drop the `# hello` part (?) that is, I updated the test that did:
```ts
expect(splitArguments('hello \\#veryfancy etc')).toEqual(['hello', '\\']);
```
to be the more sane expectation of `['hello', '\\#veryfancy']`.
Everything else I could think of (unterminated strings, escapes etc) I
kept the same. And added tests for.
Hopefully addresses #7201 without breaking any reasonable use of the
code (though @partouf raises fair concerns about this.)