Threaded cwd

Remember current directory per thread. Map paths passed to ChDir.