Moved ppm_test code out of main into separate functions (untested), and slightly improved render_wireframe efficiency