Split out several network-related helper functions from karte_t::interactive().

This moves all the network command processing out of interactive()
and into process_network_commands() and its two new helper functions.
It is purely a refactoring and should not result in any functionality changes.