Switch to a Distribution implementation in C

This makes a marginal difference in performance, but will hopefully
allow us to switch from MVar to a more efficient lock implementation.
Allow setting the initial value of metrics