--depth for register

As discussed on IRC. 

Right now the depth is hard-coded in line 475. This needs to be taken from the command-line argument "--depth" (or 0, if "--collapse" is used).