Bug fixes and code cleanup
Bug fixes and code cleanup

Moved around code and cleaned up for readibility.

russellfolk/Pthread_Power_Fault_Tester,russellfolk/Pthread_Power_Fault_Tester,russellfolk/Pthread_Power_Fault_Tester