Add some error handling to autocomplete.

This is a minimal version of how the backbone models handle errors, except that
I put the JSON parsing into the error callback rather than directly into the
autocomplete library, in order to keep the latter more generic.

Testing Done:
All unit tests pass, except some VCS-specific ones, which were skipped.

Reviewed at https://reviews.reviewboard.org/r/5766/