Add possibility to load events with a function

Replace the `events_url` option with a `events_source`.

- If it's a string: no changes (everything remains like it's now).
- If it's a function: this function gets called and it should return the event list