Ported from ViridianSpark library. Passes initial Stylecop tests.