Refactoring of contrib.test_networks tests

Some simple refactoring of contrib.test_networks tests in order
to make it easier to share unittests between v2 and the v2.1 API
in a following changeset

Partially implements blueprint v2-on-v3-api

Change-Id: I87e475acdaabacdcceaaf73b3ad831292644d3c7
Add instance_group_get_by_instance to db.api

Add a new method to the db.api that lets you get an instance group by
instance UUID.

Change-Id: I3d2a019c8f97166ec55574c610d12f572afb2bd1
Related-bug: #1379451
Merge "Add instance_group_get_by_instance to db.api"
Merge "Refactoring of contrib.test_networks tests"