extend comment on read_stream_generator
add patch-able read/write/open funcs; refactor read_stream_gen

1. add proxy functions for read/write/seek/open/close,
    which are patchable by mock.patch for unit tests.
    those are in *storage and called _read/_write and so on.
2. refactor read_stream_generator
    - change the signature to take the new proxy functions
    - simplify the structure by removing the special case
      for a segment going to the end of the file.
      Now we also do the segment size counter if it's going
      to the end and adjust the buffer_size, but the
      performance drawback should be minimal.
      The code is much simpler now.
3. adjust irodsstorage to use the common read_stream_generator
    that also simplifies maintenance.
fix the segment size of a segment reaching file_size

The calculation of a segment with segment_end == file_size
was one too long.
This happened because we have to add one to all other
segment to include the last element when we count from zero.
example:
'abcdefg' len 7
segment 0-3 (without +1) -> 'abc' len 3, element 0,1,2
it should be
                         -> 'abcd' len 4, element 0,1,2,3

When we add one to the file_size segment, it became one too long.

The change is replacing segment_ends of file_size with the
END symbol from storage_common, then the adjustment that we
already do works fine.

side-note: The code could be further simplified by removing
all START and END markers inside the read() functions of the
storage before giving the range_list to read_stream_generator().
This would tie us in a bit more in that we have to know the file_size
before retrieving the file.
(currently we need this information to build the content_length
 response header, so it's reasonable, but I'd leave it for now)
fix indentation