HPCC-8692 Fix OSX build issues

Mostly related to location of template instantiation.

Signed-off-by: Anthony Fishbeck <Anthony.Fishbeck@lexisnexis.com>
Merge pull request #3910 from afishbeck/osxbuild8692

HPCC-8692 Fix OSX build issues

Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>