Refactor to a more generic 'external' filter.

See also: https://github.com/nanoc/nanoc/pull/385