BAC-756: refactor Masthead

* remove $avoidUpscaling parameter from Masthead::getThumbnail()
* code cleanup
tests/php-services: add helper shell script
Add unit test for AvatarService
Merge pull request #1477 from Wikia/bac-756-masthead-refactored

BAC-756 Masthead refactored