(#647) Decompose `lines'` into smaller functions.

Then apply in order:
 * expand graphics
 * split lines
 * then append spaces on lines that are not 0 modulo window width.
(#647) Handle cursor positioning edge cases in SimpleLayout

Signed-off-by: Wayne Warren <waynr@sdf.org>
(#647) Ensure EOF cursor behavior remains the same.