use cached query to lookup users by ID

this was already the default in the middleware so should have been
enabled already.

this is properly invalidated on saves.
formatting tweaks
Merge pull request #3268 from dimagi/caching

use cached query to lookup users by ID