HashUDF refactoring, unit tests for HashUDF