Don't mutate cwd.

Running composer dumpautoload should not mutate cwd.

Refs #5011
Make method name better represent what it is going to do.

Refs #5002