Initial commit of testing code
First working version of test harness

Hopefully people will write some now :)
Further cleaning tests
Fixing merge
Adding one event mode plumbing
Forgot test code
Merge pull request #4132 from PerilousApricot/feature/oneEventMode

Fix oneeventmode