Coffeescript implementation of Guibas & Stolfi's algorithm