Change order of evaluation of detectModulePath
Structure functional tests
Provide proper exit code