(Bug 4196) err sub instead of $self->{error}  ... and return pattern

Also renames $self->error to $self->send_error, to make it easier to
distinguish between setting the message ($self->err) and sending out the
error notification ($self->send_error)
(Bug 4196) Refactor: remove one level of indents