Refactored a few internals of ComponentPeer.
Compile fix for the plugin host in MSVC