Structure cleanup processing using defer
File copying infrastructure
Proper creation of nil errors

Go has a gotcha where an apparently nil error value isn't really nil:

http://golang.org/doc/faq#nil_error

The workaround is to convert an explicit nil to the error type, which
in this commit, amounts to changing a function return type to error.