[DDMD] Work around multiple-static-variable bug in dmd by removing the array

Replace the variable 'name' with a ternary operator, and take the opportunity to move the variable declarations to the point of initialization.