Some refactoring to clarify object structure, and fixing bug that prevented unbinding of events