better termination of event loop
Merge branch 'master' into F_trajectory_database
implement reading trajectories from a mongo database