Move macros to change root path to separate file

Means we can use them elsewhere.