Event bus & other fixes

I moved some inter-component communication to an event bus, which cleans things up a bit. This also contains a few other bug fixes and improvements that I made along the way. Test before merging.