moved resolve-rootfolder to separate script
ported other script across to module