Added useful functions to iotools.py
Closed opend files in compare.py
Init SegmentBySegment test