Fix writing arrays to matlab with wrong byte order
Test reading and writing of big-endian data