Made some changes to loadConfig, added a parser to allow for more readable config files. Currently has a bug on line 101 which has been noted by a comment.