[tests] Allow for different path setup when running unit tests. No difference for win or linux, but OSX and iOS, run executable inside a bundle. Unit tests execute on OSX from command line tool, in bin directory.

Introduced just another method to query for a different resources directory, only used in unit tests. Refactored common code.
Also updates the class in tutorials with same code.