Fixed compile time type conversion issues and undefined variables.
Removed P/Invokes, now uses native ContextMenu handling.