stable json serialization, better scope support