Add unit tests and fixes for increment_counts

This commit adds unit tests for the increment_counts function. In the
process of writing them several bugs in the function were fixed too.
Add unit tests for ReadSubunit helper methods

This commit adds unit tests for the remaining helper methods in the
ReadSubunit class.