Only set NODE_ENV to 'cron' when running from command line.
More tweeks to get tests running consistently.