Fix change_node_name bug
Created by: jpoeppel
Changing a node's name a second time resulted in a KeyError with the first new name due to an interesting property of allowing mutable objects as keys in dictionaries (didn't know that was possible before).
Kolja Berger also made the networks.py file more PEP8 compliant which I added to this PR.