Improved $.wikibase.siteselector

Fixed triggering "selected" event, minor refactoring, fixed/improved tests.

Change-Id: I7da068e1173cd39b688937265c6ca35f1876d49d
Merge "Improved $.wikibase.siteselector"