SpecialPage Needs Translation

Refactored. Replaced direct mysql php functions and Mediawiki database
function query with MediaWiki selectField and select database functions.

I also optimized the SQL query, JOIN/NOT EXISTS makes the query slow, so I
changed them with regular from case with a NOT IN ($sql), an it worked
faster. I hope it is even faster at omegawiki.org :)

Bug: 56220
Change-Id: I41fb7c2221c3a5a4c1856db907fed19f79db91d2
Merge "SpecialPage Needs Translation"