Bug fixes + some new features

- Cleaner application exit
- histogram drawing
- auto-contrast
- Add copy/cut/paste/clone/declone action for nodes (still missing some
actions and key binds)