Refactored payload testing code to its own module plus schema tester, added a safe guard
around the main loop
Added copyright statements