Complete port to .net 4.0

Complete port to .net 4.0 is complete with the same test result as .net 3.5
![net4](https://f.cloud.github.com/assets/696662/146542/a1636c90-748c-11e2-8f6a-ebc2dbbe0b82.png)