adding support for local file copy; js tweaks for json document requirements