More security fixes.

More specifically, this patch addresses the use of the HOME
environment variable, allowing the user to create arbitrary root-owned
directories. I'm not sure that this was a vulnerability, but it was
a problem.

This commit also cleans up the way that container names and locations
are specified, since it was taking place in multiple locations.