Refactoring, StyleCop, CodeAnalysis, .NET4.0

As titled, plus adding the missing `TestMethod`