Added a config directory, a logfile, a user config directory, fixed a few bugs...