Added line editor
Code cleanup
Refactored edit mode