Reorganize the code a little bit.
Added structured log files.