[#1617] Clean up templates/package/related_list

Stop using the package dict unnecessarily
Fix pep8
Don't pass context around unnecessarily
Merge branch 'master' of github.com:ckan/ckan into 1617-detached-instance
Merge branch '1617-detached-instance'