Implemented basic log file rotation.

Still have to write tests :P