Removes some testing code, standardizes way in which variables.logObject is accessed, and prevents writeHeader() from writing the header if there isn't anything that has been logged.