Finished implementation of config file. Fixed minor bugs