Bugfix: the first shard in Java has number 0.

Also: use the same check for InMemoryShard and HBaseCellSource.
Bugfix: Source was not serializable.
Formatting in HadoopPipeline test.