Improved trap handling in toDex. Dalvik only allows a single set of handlers per code block. Especially, the intersection between any two sets of trapped statements must be empty. If we now have traps for 1-5 and 3-5, we cannot just keep them as this will fail Bytecode verification. I improved the situation by merging such traps. In the example, both handlers would form a single trap set spanning 1-5.

This is not fully sound. To be fully sound, we would have to generate two sets: 1-2 (handler 1 only) and 3-5 (handler 1 and 2). Efficiently implementing such splitting is left for future work, though the infrastructure for it is there now.