Remove extra commas and stuff

Remove extra commas in the last element of arrays, and other general markup irrelevant stuff