Cross compilation support
A few more tweaks to keep nudging us towards the goal of supporting cross-compilation.
- Changes a few hard-coded relative paths to allow for the restructuring that happened during the CVS-to-Git transition
- Improvements to the mk function's parsing of ModuleDB
- General sanitising of scripts following ShellCheck analysis (that's a link to an external site)