Improve docs and refactore std::os.

Refactored:

* homedir
* setenv