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.
Merge pull request #486 from Icenium/vladimirov/fix-profile-dir

Fix setting of profile-dir