Implement vs and ps resource creation

-Fixed some cleanup code
-Added a SAFE_RELEASE macro.
-renamed some variables and fixed case.
Code Formatting

I'm still playing with a consistent style I prefer.  Not sure what I
like yet.