Hi! Great questions. :)
All you need is in the source code.
Here is the cli source that generates the merkle root, the nullifier and the ZK proof: https://github.com/tornadocash/tornado-core/blob/master/src/cli.js
The another important source is the contract, that is here: https://github.com/tornadocash/tornado-core/blob/master/contracts/ETHTornado.sol
As you will see in the contract it uses a merkle tree that has a root history. So your root will be still valid after someone else deposited some ETH and the current root has changed.
I hope I answered your question. If not (and I know the correct answer) ask, and I try to answer.
But first of all, check the sources. The code is relatively simple and readable. TC guys made a very great job.