Refactor to a less efficient but functional-oriented hashing mechanism (in particular tuples are now created twice), but it will allow better evolution of the program
Some fixes after the refactor, including supporting tests.