Refactored test suite template code

Restructed test suite helper and main code to support tests suite helper
functions, changed C++ comments to C-style, and made the generated
source code more navigable.
diff --git a/tests/scripts/generate_code.pl b/tests/scripts/generate_code.pl
index 284f6b1..5846c0a 100755
--- a/tests/scripts/generate_code.pl
+++ b/tests/scripts/generate_code.pl
@@ -152,7 +152,7 @@
 
 
 /*----------------------------------------------------------------------------*/
-/* Common helper functions */
+/* Common helper code */
 
 $test_common_helpers