Re-define 'extra' as dict_or_none.

Changed type of 'extra' fields from str_or_none
to dict_or_none for Port and Chassis.

DB model defines 'extra' as a JSONEncodedDict which is
a type decorator that stores a value as a json string
to the database and parses it to a dict when loading the
object. That's why we need to change the type of the
'extra' field from str_or_none to dict_or_none.

Test utils have been modified to simulate behavior of
DB layer better.

Fixes: bug #1194072

Change-Id: I2c73069f795754078ce8cba50ee669cce2f4b27d