How to create a merkle tree and get merkle root for merkle distributor contract?

The current recommendation is to use our specially designed library:

Everyone is highly encouraged to use this instead of the earlier recommendations.