Import initial version of the networking script

This is an initial import of the networking script. It also contain one fix in the scripts code.