Created persistent swarm information.

* Created Swarm entity to manage peers in a swarm.
* Network messages now implement EventEmitter.
* Added support to close opened ports in the Gateway.