Improve handling of collection names in generated JS

1. Generate correct mongo shell syntax for collections with names that aren't valid dot-separated JS identifiers.
2. Change generated names for temporary collections so that they are valid dot-separated JS identifiers, and to put them all under a `tmp` pseudo-namespace (so that they appear in the API as sharing a `tmp/` sub-directory.

This is another extract from my WIP branch for #140.
That's a good point. You get a unique value each time you execute it, but that wasn't expressed here.

Both these fields become `val`s, by the way, which is nice, I think.