Add SwiftV1.request helper

Previously, XMLHTTPRequests that needed swift authentication were made
in almost every function and the authentication headers were manually
added.  This made it easy to accidentally forget to auth in a request.

Now we have SwiftV1.request, which will construct an xhr request that
includes the swift authentication headers.
Add handleXhr helper

There is a repeated logic pattern when handling responses from swift:
call some function on an error, success, notFound, or auth issue.
Classifying a response is always done using the same http status
criteria.  I've added a helper that takes the functions as input,
using defaults when a function is not provided.
whitespace cleanup