Drop obsolete members after release v0.17.0
Fix some issues pinpointed by Code Analysis
Upgrade to .Net 4.0

Fix #654