Use API for formatting Wikibase item links

Change-Id: Ida65a6c07572bf146ac496e5e23fb0615ddc73db