Configuration files and global settings, and some cleanup