Count total unique words using methods supported by Vector and GSL::Vector

/cc @alfredxing

Fixes https://github.com/jekyll/jekyll/issues/2743.