Moved more code to log.lua

Segment for creation of files is now in log.lua. CONFIG is now also global so commands can read the correct configuration.