Gravar-mail: Efficient sampling of spreading processes on complex networks using a composition and rejection algorithm