mw.Title: Add new static methods `newFromFileName`, `newFromUserInput`

This is the replacement for Ia57e4b0e804.

Use cases:

- UploadWizard: Suggesting valid tiles for files supplied by user
  whose names are invalid MediaWiki titles.
- Upload Form: The same.
- Community scripts, VisualEditor upload gadget, [...]: The same.

Bug: 64912
Bug: 64922
Change-Id: I260ba883548975263bba03d25f6d11d3d9bbfbd9
(cherry picked from commit cc8b00ed5bf69dafac2413d9c4387523a14bc62a)