Refactor uplevels to support alternative temp directory names

Update uplevels processing to allow generating e.g. flattened temp
directory structures.