Shift events stuff to monitors.
Fix compilation errors.
Add auto-factoids db creation.