Fix leaks that happen on closing the solution.

Note: Most stuff is still kept in memory until the next opening, due to the way our current Extensions are thought out.

We keep references to short lived objects in long lived objects, and we end up piling them up until the extension's data changes. (In example, CommandHandlers keep their data until the next solution is opened.)