I added self intersection test. The unfold algorithm unfolds faces until there are no faces left to be unfold.
I coloured the separate unfolded patches with separate colours.
The unfold schemes will be the next big step (or the layout editing). I think if I force faces to be treated as faces (not triangles) the output will be more pleasant. I think the scheme can be controlled by the order of the face checks (left/right/bottom triangle) and the amount of faces to unfold in the branches. At least I hope so.