This moves all of the "if running over Tor" logic to one place (in init.cpp).
It also fixes issues where settings made in the GUI (like fUseProxy) and stored in the wallet could not be over-ridden in the bitcoin.conf file or command-line, by moving command-line-flag-setting code to after the wallet has been loaded.
That also meant moving the "bind to listen port" to after the wallet was loaded, but that should be OK 99.99% of the time because the lock file is still checked early to protect against accidentally running bitcoin twice.