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.
Another option would be to add the output `Collection` to `Workflow`, which was even done in some earlier draft. If the 2 are always being passed together, it's a sign they should be captured together in a common abstraction -- and `Workflow` is that abstraction.