Added cwd option for programmatic mode
Added cwd test file