Decode URL encoding in resource attriute for images

In getFilename(), decode URL encoding and replace the search
for 'File:' with a more standard ./ stripping regex.

The ./ regex came from generateContents) in the CE class;
made that code use getFilename() instead.

Also apply decodeURIComponent() to the result; but protect against
exceptions because it's a useless piece of garbage.

Change-Id: I7e81a8dc26d1c636c6571d96f43a394a53490587
(cherry picked from commit 7d867298580e7ec107bfe8e2cdf7fdaa33a1af94)
Another default alignment fix to MWImageModel

This time in the installment: Allow the model to predict the type
and default alignment based on parameters rather than just the
current status. This is important for initializing images, especially
inline images whose 'align' attribute is null or undefined, but must
be examined for default alignment.

Also changed:
* Make sure that model operations change each other, rather than
  let the editor change 'unrelated' model parameters.
* Use selectItem rather than chooseItem to avoid emiting the 'choose'
  event on edit dialog initialization.

Change-Id: I8c23fc53e7738d59565294d8b98fe7351bebbc67
Merge "Decode URL encoding in resource attriute for images" into wmf/1.24wmf6