Ported unusedfiles.py to pywikibot/core, added unicode support.

From unusedfiles.py from pywikibot/copmat to pywikibot/core. Porting
involved changing the import files. Patched to include Unicode support 
using encode method on relevant strings. Fixed previous way variable
"uploader" was initiated, as it wasusing indexing to access a 
dictionary in a list, causing an error, now uses the correct key.

Bug: 56901
follow-up from I8bb5bdcf1518f33a1d40ec807f752bf27a5d73a4
Change-Id: I724c1b8e8ea97be6aac21e4533d303466e1e90a0
Merge "Ported unusedfiles.py to pywikibot/core, added unicode support."