Fixed CodeAnalysis errors by making CodeAnalysis run only in .NET 4.5 build

* Fixed CodeAnalysis errors by making CodeAnalysis run only in .NET 4.5
* StyleCop related cleanups