Adding test for numeric rewriting
Fixing numeric logic
Fix inverted case for order literal rewrite
Tests for rewrite order literals