Refactor and expose private functions within `libcontainer/user`.

This patchset refactors much of the code in `user/` (such as using structs to return user data and general readability improvements), exposes several previously private functions (`parsePasswdFile`, `parseGroupFile`) to allow for callers to pass `io.Reader`s as a data source (massively improving the usability of the package) and adds several exhaustive unit tests for RunUser parsing.

Also, the gargantuan function signature `user.GetUserGroupSupplementaryHome` was changed to the more readable and understandable `user.GetRunUser`.

This patch was created to assist the implementation of docker/docker#7537, in order to ensure the RunUser configuration parsing can be handled consistently both internally to libcontainer, as well as external to libcontainer.

Signed-off-by: Aleksa Sarai <cyphar@cyphar.com> (github: cyphar)
I agree with your points and also that this is subjective. There is something to be said about simplicity of using the API, though. For e.g. http://golang.org/pkg/os/user/#Lookup. It does what is expected on Linux. IMO, we should only add features, if there is a solid requirement. I think at minimum a wrapper API that passes in Readers for /etc/passwd and /etc/group should be provided, so the clients have a simpler API to call when possible. I would defer to @tianon and @crosbymichael on this one. ( I don't have a strong objection, just a subjective opinion ;) )