Identity model changes

Mostly %s/id/uid and some small fixes.