Create BinaryStateReader and BinaryStateWriter

Centralize code to read and write binary state and include workaround for this [bug][1].

[1]: http://bugs.kerbalspaceprogram.com/issues/821