Extract accounts logic to a wrapper module

In order to re-use the same functionality for the Mirror project. Mostly
cribbed from the code here. Only functional difference is that it will purge
unmanaged non-system accounts. The `vagrant` and `vboxadd` users have been
excluded in the development environment, accordingly.