Support varying listeners

I encountered a problem while changing listeners during a callback function whereby sometimes the function would be executed twice. I found that it was due to the list of functions to execute in 'handle_events' is stored as a filter but the thing that the filter is based on was changing underneath it. Using a list appears to solve the problem.