Added a new array output mode

Cleaned up output code so it's more modular and less IFDEF-y