UploadWizard: Don't throw JS errors; instead report them in UI

Currently, Upload Wizard throws JavaScript errors towards the user's
JS-console when entering characters that are not valid in titles,
including square brackets, for instance.

After applying this patch, UploadWizard will properly report these
errors by leveraging the jQuery.validate plugin.

Further clean up:

- When constructing jQuery objects, either used valid HTML or a
  single tag as the string argument.
- Combined multiple `var` statements.
- Avoid executing RegExps unnecessarily by passing the title as
  arguments to subroutines.
- Using `.getMainText()` instead of `.toString()` to avoid unnecessary
  API normalization.
- Make phpcs happy by breaking lines longer than 100 chars.
- Resolve a bug introduced while fixing Bug 32469: Do not clear errors
  of validator that runs immediately from delayed method.

Bug: 64908

Change-Id: Ib54bf84497e37f8fba614e5c4dfa11550029b87d
Merge "UploadWizard: Don't throw JS errors; instead report them in UI"