Move internal prism stuff back here.
Added back some more functions.