add wrappers for aggregates
implement and test aggregates
add pairwise_distances
add transpose support
add query logging
fix some array name clashes