Powernets machines connection polishing

* Makes machines connecting to powernets correctly call the _connect_to_network_ and _disconnect_from_network_ procs instead of directly adding the machines to the powernets.
* Removed a now unused variable

__Must be merged alongside #4063 (because the variable removed is also in solar panels and tracker)__
Note : _That's why Travis is not happy_