Cleaned up code style

basically ran it through Resharper and made most of the suggestions