Support an acceptable group of up to 8192 bits for SHA-1 and SHA-256 Diffie-Hellman Group and Key Exchange (issue #1973 and #1777), and refactor corresponding classes to avoid code duplication.
Use lambda expression.
Avoid initializing HostKeyEventArgs when there are no event handlers registered.
Fix some minor warnings, and code formatting.