Refactoring, fixes
Fixes #23
Fixes #21
Fixes #20
Now import can be undone