Preparatory commits for "universal door"

These changes are needed to support the universal door.
Reviewers: @josh-ripple @mtrippled 
`error_code` is a nested type