[Version Control] Optimizations to Commit Command.

Replaced FindMostSpecificParent algorithm with a non-recursive root common root
algorithm.
No longer do recursive directory checks for single files.
Commit Command test run is now accurate.
[SourceEditor] Fixed dangling event handler.
[Ide] Lowered heap fragmentation caused by assembly lookup.
Merge pull request #301 from Therzok/redundantCheck

[Version Control] Optimizations to Commit Command.
[TextEditor] Rules no longer hold a reference to their syntax mode.
(fixes a leak when implementing semantic highlighting)
[Ide] Fixed a leak caused by non destroyed context menus.
[Ide] Help the GC to free managed object references.
For some reason the profiler says they're kept in memory, but the real
problem is that the menu items contain references to Documents (Text
editor etc.). That's causing a leak.