Add a dumps func and a new constructor for inseralizer