Add an `ErrorCode` type and error codes.

Remove the `sperrors` package.