Reduces the number of calls to get_package_type.

_get_package_type in the package controller is called at the start of several functions to retrieve the type field of the package - this is done with a direct database call.  

Most of these methods will go on to call package_show before needing the value of package_type, and so this PR removes lots of the calls and replaces them with pkg_dict accesses closer to the where it is needed.

The _get_package_type comment has also changed to more closely reflect what it actually does (rather than what we wish it did).

This should close #2080