[Instrumentor] Move common instruction IO functions into a class (#205460)
This commit moves several instruction-related IO functions into a class
instead of having them defined in the instrumentor namespace. We add the
BaseInstructionIO non-templated class because InstructionIO is a
templated class. Adding the common functions into InstructionIO would
force us to define them in the header.