Improving code folding.

Used some code from the ISE to make a huge improvement in code folding.