Fix deserialize() method, use 'method' parameter first

Check 'method' parameter first, rather than trying depickle and if it fails falling back to json, as this defeats the whole purpose of this patch.