Fixed sortByIdAndLine

The old sortByIdAndLine function was broken and caused some issues.
Notably, firefox and chrome gave different results so the VCs
displayed in a significantly different order. This made cooperating
frustrating because going through them in "order" had no meaning to
coding partners.

An example of this behavior (which uses vc data derived from a real
resolve session) can be seen here: https://gist.github.com/euank/5450654

I also parsed the line numbers as integers and changed the ternary
operators (which caused the problem in the first place I think) into
more readable conditions.