Modified view_file to return PDF version by default, unless a ?native parameter is passed, in which case the native file is returned.  Also quite a tidy up of the code.