Tweaks to JS formatting and Json serialization