Manage events a little better, rescan a lot more.
Separate edit-mode into individual files and fix stuff