Fixing bug #3136.

Second-order pattern-matching now respect variable abstraction order.
Adding a test-suite for second-order matching order and indexes.