large refactoring. switches to functions where possible to greatly reduce line count
gets description and enum elements printing as correct JSON