Removed some memory leaks

Hovewer, there are still many memory memory leaks. It seams that model
event listeners are not correctly unbound on controller release.
Fixed many memory leaks

Most of them were caused by unreleased controllers and by
non-unbound events. One memory leak was caused by duplicite entity id.