Rewrote config loading code and configfile format

Now less old crappy code!! Also much more readable and unshitty stuff.
Changed the format of defaultcfg.json as well.