Fix write bug and implement Close

The write function discarded data when the array passed to it was
bigger than the buffer. This resulted in readers missing data.

The list of readers is now save into a list.List struct.

Close now clean up the list of readers