Tidied up config system, fixed #5.