C#/TestUtil: Rewrite all code