Make testall test what's in the current folder, not `dirname $0`.

This is so that it can be called directly from masterfiles.
Export variables to tests so we can find the enterprise plugin.
Merge pull request #1309 from kacfengine/testall_fixes

Testall fixes