Huge code cleanup and format update as well as a couple minor fixes to the logger and loader classes