Several new optimizations that give better translations for pattern matches

Out of curiosity. When does this happen?