Rename user_cache_find to user_by_id().

Rename user_cache_find to user_by_id() to be consistent
with func_by_id(), space_by_id() - API variant which
does not throw exceptions if an object is not found.
Minor code refactoring.

Encapsulate error handling in user cache search functions.