Updated the copying of the buffer state

Initially, copying the buffer state meant just recursively copying the
pixel table which the buffer possessed. However, this has now been
updated to contain a recursive copy of the pixel table and a recursive
copy of the cursor object possessed by the buffer. This way programs can
switch in and out without having to reset where the cursor was.