- Moved the clip/window transform and affine projection to their own function

- Cleaned up the fitting-app code