Clean up the WikiConfig mess

A weird bug in round-trip testing uncovered major WikiConfig issues.

The image at the top of
http://parsoid.wmflabs.org:8001/result/fe29e5f3517a24b7345b6d802c14a74f8222ae2f/es/SuperDrive
was not recognized as such on the first parse after restarting the server, but
would work on subsequent parses. Other localized images in the page worked fine.

I tracked this down to the LinkHandler not recognizing the localized 'Imagen'
namespace as being the file namespace. It checked
env.conf.wiki.canonicalNamespaces, which normally only contains the default
namespace names and no aliases. So this should never have worked, except that
the Title constructor modified env.conf.wiki.canonicalNamespaces by adding in
all aliases as well. This only happened when the first localized title was
constructed, so would only work from the second link on.

Since WikiConfig instances are cached across requests, the modified WikiConfig
(with the extended canonicalNamespaces) would work for subsequent requests.

Additionally, the WikiConfig prototype defined a long list of properties,
which were then overriden in instances. This is dangerous, as a small error
can cause configuration data to leak from one request to another.

This patch does the following:

* Stops the Title constructor from messing with namespace mappings

* Switches namespaceIds to use the same lower-case + underscore format as
  canonicalNamespaces

* Uses this in the LinkHandler and elsewhere

* Removes prototype properties in WikiConfig and defines them in the
  constructor instead.

* Uses underscore-prefixed property names for private WikiConfig members

* Clarifies some misleading variable names in WikiConfig

* Uses this.* instead of the non-standard conf.* in the WikiConfig constructor

With these changes, the image on http://es.wikipedia.org/wiki/SuperDrive is
now recognized consistently.

Change-Id: I93e64396142416a8f0fed665f5d2cb9ef8b1ddad
TODO: Add parser tests for localized namespaces
Merge "Clean up the WikiConfig mess"