Move instrumentation code for different platforms (coff/macho/generic) to separate functions.
+50 lines of code, but way more readable, especially if (or when) we end up adding elf-specific instrumentation.
This is https://reviews.llvm.org/D28498 without any new functionality.
These could all take ArrayRefs.