Proper handling of settings.txt

Bot now shuts itself down cleanly if the settings.txt file is empty or
if it contains errors.