Improve Timelines Query Performance

Improve Timelines TSQL Query Performance. Query plan shows that calculating ancestor timeline in ORDER BY clause causes SQL to create a comple temporary tables; instead, precalculate ancestor timeline calculation.

Code Review: http://mrccodereview.cloudapp.net/ui#review:id=1150