make the source dir detection actually work.
More cleanup after plugin merge.
Merge pull request #3 from papadop/SourceDirImprovements