Add tests for remaining functionality, implement distinctKeys and distinctValues