Reimplements users(1) in C++.

This reduces the lines of code by roughly 50% (not counting the COPYRIGHT
header) and makes it more readable by using standard algorithms.

Approved by:	bapt