Mostly changes to the build system and scripts to support krun.