Add proper logrotate script and add some more tests.