Implemented log file splitting.

Closes the following issues:
Fixes #3