Rework and add new rules for simplifying ramp/x and ramp%x

Fixes issue #458 

I'd appreciate another set of eyes, because these rules are pretty nuts. They should be tested by the test cases at the bottom, and also by the simplify fuzz-tester.
Yeah, upon close examination, this seems safe. Sorry for the false alarm.