Fixed os.getcwdu code for Python 3 compatibility

This is building on changes that @takluyver already made.  I changed out
instances of getcwdu with our Python version specific core.getcwd.  I
also added some very basic unit tests for those changes.