Add config file, fix bug with timeout, improve logging, refractored list_dir()