Split Template Haskell code into its own build

This works around an assertion failure in ld64 from having too many object files in one library. See https://alpha.app.net/maxpow4h/post/4694939