fix: better serialization in dump/console.log

Serialize functions, null, undefined, etc…

Closes #640