Read/Write rectangles of pixels

Added in readRect and writeRect which takes an array and either reads in
that many pixels or writes that many pixels