Contribution to @khalas for his sprint merges!
Refactor
New tests + fix to one of them, fixes #871
Trim bad trailing string from PATH manip

Fixes #870
Changelogs re #870, #871
temporary troubleshooting
Mode assertion test to guard against wrong int/oct stuff
More tests, test refactoring, more mode fixes
Run full test suite again, oops
Left testing homebrew stat call in by mistake. Oops.
Merge branch '1.6'

Conflicts:
	docs/changelog.rst