Added JavascriptSwitch helper method, stylecop warning fixes