Refactor status/perfdata stats registry.

Fixes #5622