undo/redo capabilities

- funBarText automatically updates
- added updateFunBar function
- undo/redo inserts
- added removeLine and insertLine functions
- various bug fixes