Add support for logrotate config files

Also introduces file.psed, a pure-Python version of file.sed.