Added optional appDir option to don't depend on the cwd.
fixed appDir assignment after use
Merge pull request #70 from sweetpi/master

Added optional appDir option to don't depend on the cwd.