Fixes for npm home, bugs incorrectly parsing a cwd

Uses logic similar to bf9048e to fix issue and updated readme for both `npm docs` and `npm bugs`

Fixes #4204