Encode the join result instead of joining encoded parts
Reduce generated file chunk size. Wrap quotes around function calls to ensure properly formed json. Remove base64 encoding (they're faking it now).