refactoring and cleanup

(re)introduce FoldDetector to make the API easier to extend
Select only meaningfull characters
Improve folded boxes visual style