Extension:PWD/Draft code

This is some draft code that I have been working on, in response to Mr. Z-Man's code review. It does not yet work, and not all of his suggestions have been implemented yet.