Rework binary_file read and write interfaces because the wrong overload was sometimes being selected, such when writing a non-const buffer, and also because the treatment of length was inconsistent. Overload resolution is now solely determined by the number of arguments, and the size to write is uniformly n * sizeof(the underlying type). Test cases and user code updated accordingly.