Refactoring the 'os' extension functions a bit, and documenting them properly