Panning/rotation/zooming support for 3D viewer

Here is an initial support for panning/rotation/zooming for the mesh viewer.
This is mostly a Perl port of the same code from Printrun, and should work fairly well.
Please note that my Perl skills are close to none, so feel free to tell me if I made anything ugly :)