Fix transform test so that only the actually generated variables are compared to the reference.
Fix test references for the changed paths (no leading / in paths)
Clean up transform test code
Fix path handling in tests codes