Remove duplicates
Avoid loading invalid toItems in entity lists
Dont depend on entity metadata wrapper as much
Merge remote-tracking branch 'origin/master' into 7.x-1.x