Start on an impersonate function.

[I'm boombatower now]
This is an initial version [of some code that fixes #1], not sure this is how we want it to work. Do we want to accept UID or only user objects?

The restore function is only for looks, not sure if that is good style.

[The change to include fixes #1 is some magic that makes it so that if this PR is merged #1 is closed]