Allow overriding env using tags, fixes #792. Correct some path handling on Windows, fixes #788. Correct calculation of common ancestor path, even when specs are filtered, fixes #785.