Cleanup

Miscellaneous cleanup of style and formatting

Add ReSharper annotations, so that we can mark public members as being used, and quiet the ReSharper unused warnings.

Fix FxCop and StyleCop warnings.