Improve loading of plugins and adding new listeners. Also, fix some bugs
related to the plugins menu, i.e. ArrayOutOfBoundsException when there
was no plugins added at all.