Clustering Multivariate And Functional Data Using Spatial Rank Functions