Extract binary writing methods into a separate module (binaryio)