WIP: add basic implementation of global filters

First pass at the feature suggested in #260. Not sure if this is something you want or if there's a better way to do it, just opening up a discussion.