Add status_t
Refact memreader, memwriter
Make reader and writer return status_t