Implement scope ordering by criteria or proc.

Current spec status: 543 examples, 0 failures in 4.03 seconds.