Refactored the implementation of code-segmentation, and added lots of clarifying code-comments. This fixes several block-comment, as well comment-folding and -embedding related issues