Added net module, implemented large parts of protocol