Improve filters.

Changed filter interface to distinguish between string and buffer filtering. Added replaceXXX filters.