Add functions hist! and hist2d!

These functions allow writing or adding counts to a pre-allocated array.