Fixes to unix build.sh so it is compatible with new KoGrid 2.0 build

Though some effort was made to make the unix build.sh compatible with KoGrid 2.x, it failed hard on the new html templates.

This patch fixes that, and does a couple of other small fixes so the build is even closer to the canonical powershell build.