(maint) Add cotire to the build to reduce build times.

Adding cotire to our CMake projects which enables two things:

1. Precompiled headers: for incremental builds, this reduces the amount
of time the compiler has to spend parsing system headers.

2. Unity builds: for full builds, this reduces the compile time
significantly by having the compiler compile only a single source file
that includes every other source file.
(maint) Rework logging for unity builds

Use a macro - so it can be redefined in a unity build - in place of a
static variable.