Cleaned up the path handling and all imports of os