Sanitize
Improve shape converter

Shapes are sometime so badly ordered, that the first given way does not even
conincide with any of the endpoints, in those cases we will look over all the
nodes until we find those two which are possible endpoints
Don't let threshold grow indefinetly
Remove some line prints