Replace _dump if checks with single lookup

Replaced potentially multiple if statement checks with single dictinoary
lookup using type(v) as a parameter. If the type isn't found in the
dictionary it returns the value of v by default

Moved string dump and list dump logic out into seperate helper
functions.
1 file changed