Auto removal of broken links

- Broken links are now removed automatically from the GUI and from the
backend.
- Cleaned up code a bit (changed some function names)