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
We have a default value for type of 'dataset' in the model. Is it ever possible for for bool(pkg.type) to be False? Maybe if someone sets type to an empty string, but than other things that check the type might disagree with this function.