Store the publish operation userId in an environment variable, and make the `isWithinPublish` function available as an export.

Closes #37.