Cleanup libnetwork test code
Cleanup libnetwork test code

- The libnetwork test code had some issues in not properly
  passing the network options. Fixed it.
- Made controller a global value so that every test uses the
  same controller instance.
- Cleaned up endpoint and network objects after every test.
- Extended the endpoint join test case to test the same container
  join two different networks using two different endpoints.

Signed-off-by: Jana Radhakrishnan <045898bda7d4800fe4909a9831e702ab79e266be@docker.com>

jameszhan/docker,docker/docker,mahak/docker,konstruktoid/docker-upstream,jimjag/docker,vdemeester/docker,paralin/docker,AkihiroSuda/docker,AkihiroSuda/docker,AkihiroSuda/docker,moby/moby,vdemeester/docker,nalind/docker,thaJeztah/docker,flavio/docker,konstruktoid/docker-upstream,jthelin/docker,flavio/docker,bearstech/moby,nawawi/docker,nawawi/docker,jimjag/docker,Mokolea/docker,jameszhan/docker,konstruktoid/docker-upstream,flavio/docker,yosifkit/docker,bearstech/moby,thaJeztah/docker,docker/docker,nawawi/docker,moul/docker,paralin/docker,trebonian/docker,flavio/docker,cpuguy83/docker,bearstech/moby,Ramzec/docker,Ramzec/docker,thaJeztah/docker,jimjag/docker,trebonian/docker,moby/moby,Mokolea/docker,jameszhan/docker,gnailuy/docker,jthelin/docker,gnailuy/docker,jimjag/docker,moul/docker,mahak/docker,cpuguy83/docker,yosifkit/docker,gnailuy/docker,gnailuy/docker,trebonian/docker,bearstech/moby,trebonian/docker,djs55/docker,Mokolea/docker,thaJeztah/docker,moul/docker,konstruktoid/docker-upstream,nawawi/docker,nalind/docker,paralin/docker,nalind/docker,paralin/docker,AkihiroSuda/docker,docker/docker,mahak/docker,djs55/docker,moby/moby,vdemeester/docker,cpuguy83/docker,yosifkit/docker,cpuguy83/docker,Ramzec/docker,Mokolea/docker,djs55/docker,nalind/docker,moul/docker,yosifkit/docker,Ramzec/docker,mahak/docker,moby/moby