cleanup as per @javanthropus review comments

mostly formatting, refactored #readpartial and #read_nonblock
Merge branch 'nonblock' into ruby-1.9
Set nonblocking mode from read_nonblock
Merge branch 'nonblock' into ruby-1.9
Implement 1.9 to pass rubyspec