C rewrite of various munin components