merge class moved to API, refactored clustering code
draft of hierarchical clustering test