changed how cython wrappers deal with pointers

replace redeclaration of pointers in each function of classes derived from
mc modules with a cdef'd pointer to avoid redeclaration in each function. this is much more elegant and also convenient. added mean computation to histogram action. moved increase in count in mc to top of loop, rather than end