Use PropertyId and ItemId instead of deprecated EntityId

Includes general cleanup

Change-Id: Id725982738bb5fbb3b2131487352e25e47ec2673