Add a generalised joinPath method
Expand scope tests to sanity check ID generation