View frustum work

This moves a full implementation of view frustum to the shared library, as well as some other tweaks.