More refactoring, tests, and fixes

Change from using strings to using arrays instead.  This also exposes a
bug when using the module with minHashLength set.  Fix it and add tests
to keep in check.