Fix array trailing comma inconsistency

For arrays with more than one item, a trailing comma after the last item is useful, since new items can be added easily, and items can be re-ordered without introducing syntax errors.

Empty arrays don't need whitespace inside them.