Fix bad assumptions in EntityParserOutputGenerator

This code crashed with an "can not convert object to string" for me
when I tried to import an XML dump. It assumes that all 'commonsMedia'
snaks always (in all old revisions) contained string values. There is
no guarantee this is true.

This also removes some disturbing PHPStorm warnings in ValuesFinder.

Change-Id: If87e65b8d347605ffdb944fdb8b4aaa6d7bd51cb
Merge "Fix bad assumptions in EntityParserOutputGenerator"