refactored the cython wrapper for gillespie modules