Neaten implementation and comments.

Get rid of equality and instead check specifically for a "NULL" PasswdStruct.
Update documentation.
Tests for expanduser() and homedir().