use spire's monoid
refactor 'document vector space' to use spire's MetricSpace