move odim reading and writing code in to core