Massive refactor of network_monitor.

Mostly PEP8 complaint and got rid of any suspicious code as well as some structural things.