Make yum always use arrays internally

Also handle a lot more corner casses consistently and cleanup more code.