Add to_hash method to get package metadata as a hash