Remove unused imports
Remove unused interface
Add support for sending failures
PEP8
Move FederationError to synapse.api.errors
On AuthError, raise a FederationError
Fix bug in replication