merged egfrd:gillespie/GillespieSimulator by hand