Add a centralized list of API error codes.

Right now we don't use the API error codes very much from our frontend code, but
I'm expecting that to change as we make things more dynamic. This adds a
centralized list of them so we don't sprinkle constants everywhere.

Testing done: ran js-tests, used the codes in my new review request rewrite.

Reviewed at http://reviews.reviewboard.org/r/4305/