changes to the event system, make config.h saner, working on cookies