Add explict serialization logic for source maps to avoid using JSON

JSON does not exist in cscript5.8, which causes the samples to fail to compile. we only use it to write the source map records which is fairly simple to serialize. this fixes #706