Add very basic line buffer functionality
Use line buffer for current line tracking
More fine-tuned repaint logic
Fix repaint bug
Fix spec
Fix tree builder
Add string safely (unfortunately this doesn't quite work, but is close)