Report CPU usage by user

We have a shared box and would like to track the percentage CPU used by each user, including all processes owned by a user. The backticked ps command is tested on Linux, OS X and FreeBSD.