Added computation of center of ways
Added distance to templates
Added function to remove duplicate nodes
Corrected bug in centroid calculation