Previously several models were defined with lazy='dynamic'. This would
then cause Ports.fixed_ips (or w/e was specified as dynamic) to be defined
as a AppenderQuery object and when accessed would query for the result.
Therefore in get_ports() for example, when fixed_ips was accessed
in _make_port_dict() we would be issuing an addition query to the database
to lookup the fixed_ips information.
This patch changes update_port/subnet() so that it keeps track of what
changed so it does not have to query the db for values it should already
know about.
This patch also adds a unit test for update_subnet() adding host routes
where there was missing code coverage.
Implements blueprint improve-db-performance
Change-Id: I0b2214604042a1fd362cbbf3fd70e31adf0ce279