Don't load unused events.
Clean up palette loading code.
Add newlines.
Rename add_palettes function to get_palettes and pass result back through callback.