Make sure we pull pkgs from the correct repo order
Fixes
Fix the ordering a bit more, really convoluted
Fixes to building from a specific repo order
Fix the functions.sh, to use new local / remote repo codes