Testing: Use local function when getting cwd to keep it a bit dry