Added checks for Map/Set in unsupported browsers
Map/Set are not supported in IE 11 for serialization.
IE 9/10 do not support Map/Set and even using if(Map) {}
will cause an error.
Switched to using typeof Map !== 'undefined'
In addition in IE 11 Map/Set do not properly have toString
defined and will return [object Object]
rather than [object Set]
or [object Map]
so we make sure not to test in those cases.