Use json.Marshal instead of encoder

Gets rid of some of the nastier pieces of logic in the compiler and doesn't put a newline on the end of each primitive value.