first commit of cleaner implementation using memreader
memreader implementation complete except for structs and unions