Moving clustering into commands and adding test