Normalize item ids before trying to remove doubles

This fails currently if the same entity ID is given in
two forms:
https://www.wikidata.org/w/api.php?action=wbgetentities&ids=Q617|q617

This also added a test case for this (and removed a redundant one).

Change-Id: I96c1acba7f28b20aef1a35138e76aaaad0e932aa
Merge "Normalize item ids before trying to remove doubles"