VE-1463: Encode endpoint URI

Unlike WMF we pass to Parsoid not a symbolic name pointing to a wiki, but entire URL to api.php. That URL has to be encoded, and currently we were doing it properly in MediaWiki but not in Parsoid itself (in case when Parsoid calls Parsoid :)).
VE-1463: Remove spaces
Merge pull request #4 from Wikia/VE-1463

VE-1463: Encode endpoint URI