cleanups from Tim Newell. still fatal on load, though at this point it does get far enough to spit out proceedural glsls prior to the heap going fubar.