Rewrite renderSelection to only draw once per line

Previously RenderSelection performed a fillRect() command for every character.  This resulted in poor performance on large bodies of text.  This rewrite calculates the selection box for each line of text and draws a single rectangle for each line, dramatically improving performance.
Formatting fixed and end.lineIndex cached
Fixed formatting and cache start.lineIndex
Merge pull request #1097 from GordoRank/master

Rewrite renderSelection to only draw once per line