1) Merging Daniel Golden's code in
2) Cleaning up dead code
3) Adding endianness code for error response structs
4) Correcting endianness code for other structs