fix endian mismatch

Fix some code that was using read() where read_be() was intended.
fix exception formatting

Apparently at least GCC expands variadic arguments in right to left
order, which causes the trick we were using to format multiple arguments
to work poorly. Replace with a recursive function call.
implement reading of track data