Better checking of namespace

We're aiming to get this into release-238 for release tomorrow. This PR is to dev, which will then be cherry-picked into the release branch.

https://wikia-inc.atlassian.net/browse/VE-1397
This is partially cloning/forking functionality of mw.Title class. Why not to go ahead and create object of that class and use it?