Move some history export logic out of controller into model...
For reuse by API.
Refactor history export functionality into ExportsHistoryMixin...
... for reuse in API.
Refactor history import functionality into ImportsHistoryMixin...
... for reuse in API.
Add new API decorator for raw downloads.
Implement history exporting via API.
Two new routes one that can be PUT against to poll for download_url and one to fetch a completed download via a GET. Includes simple test case. This doesn't cleanly map to REST to my mind so I have hobbled together this approach, happy for further input.

Good reading:
https://restful-api-design.readthedocs.org/en/latest/methods.html#asynchronous-requests
http://stackoverflow.com/questions/4099869/is-it-wrong-to-return-202-accepted-in-response-to-http-get
Implement history import via API.
Introduce method ready_name_for_url.

Pulled code out of create_item_slug placed in util for reused in other operations - such as creating a history export. Update history export to use this. Slugs mapped names to a signficantly more restricted character set so history export file names will now be all lower case for instance and will never contain parens, commas, periods, or underscores for instance.

Previous incarnation of this idea (not committed) also 'lower'-ed the name - this behavior is not desired for history exports the way it is for slugs - hence moved .lower() back to create_item_slug and renamed the method ready_name_for_url instead of ready_name_for_slug.

Idea from Jeremy Goecks (https://bitbucket.org/galaxy/galaxy-central/pull-request/314/history-import-export-via-api/diff#comment-1141619).