Add tests to archive_log service

Also refactored a few things to make the tests better.

More refactorings to come.

Also, I think we should probably have a few more tests for the service, but this is a start.