added filtering in merge and sort tools (see #81)