Made segment_dat usable for online processing.

Added extensive docs and unittests.