Add support for Darwin using id command

Use `id -P` on darwin, which produces a passwd like output.
Check homedir in tests.