fix strict aliasing warnings CXX-49

Fixed strict aliasing warnings and added tests for modified functions. I needed to do some refactorings to make the functions testable without friend-declarations.
Also fixed a bug in OID::MachineAndPid not-equal-operator, which compared pointers instead of memory content.