added a simple Flask listener and also refactored (again) some of the web mention code