Added support for writing byte[] and BytesWritable, and refactored collector code and unit tests.
Merge with GitHub