Clusterization added to Haskell implementation. Several features rewritten from scratch.