Added tests. Semi-functional intersections example.
Carwash example almost functional.

There remains some consistency issues caused by race conditions (when
several events are due to occur at the same time). There is no mechanism
currently to enforce the simultaneous update of multiple resources'
states. An option would be to split `Resource.setState` into
`Resource._setState` (which would only actually do the change, with no
delay) and `Timeline.setState`.

For symmetry we could then also deprecate `Resource.getState` into
`Timeline.getState([resourceIds])`.