Fix a crash with aggregates containing range and named choice
Reduce code duplication in scalar case statements
Fix incorrect LLVM type for integer constants in case branches
Add bounds check to scalar case statement