Triangles Clockwise order

Order the points of every triangle clockwise based on an internet
algorithm
Cosmetic changes

1. Split long ass functions to several functions
2. Moved some const values to the configuration instead of hard-coded
values