Allowing update of events in PREPAREDATA stage and later

* Fixes stage checking
* Cleaned code

(closes OpenFLUID/openfluid#464)