Lab 5 part 2 working

Only tested with 64 byte read and writes, but they work. Page wrap
writes are not tested. Code could use some cleaning, and maybe slightly
improved commenting.