Fix setting of profile-dir

Set profile-dir option with commonOptions setProfileDir function. Add tests for setProfileDir function to make sure correct value is used.