Optimize row_number window function 

Identify the query shape with a filter on the row_number() and rewrite it for optimal execution.
Examples of query shapes affected by this: 
https://gist.github.com/nileema/71d0099d804a10cb172b

Note: Optimization applies only if the all the following criteria are met: 
1. There is a single row number function in the query 
2. The filter is a simple comparison with a literal (compound expressions are not supported in this revision) 
3. The filter operation is directly above the window  function
@electrum This code is working hard to make sure that the window partition rows are kept together.  Do we need to do that?  If not, I think we can make this one completely streaming.