Properly merge array-like (keyless) hashes; refactor code, add more tests