Use chdir() instead of calling multiple commands.

This improves compatibility with windows, and continues to work on *nix
systems.

Refs #5011
Fix doubly inflected variable names in controller task.

Variable names should not be doubly inflected.

Refs #5002