Filtering and publishing

This is the same changes as in #8, but trying again to deal with git merge issues.