refactor: move main out of TorNet module, remove global vars