Enhance RB.BaseResource to enable uploading multiple files at once.

BaseResource had a lot of code for handling file uploads through the API, but it
only supported uploading a single file per request. This change generalizes that
to handle uploading any number of files.

Testing done: Ran unit tests.
Reviewed at http://reviews.reviewboard.org/r/4258/