RF: allow generic header to specify memory layout

Just in case someone needs the generic header to write in C order rather than
F order.