Rework key injection logic in test framework.

Pull logic for how master and user API keys are determinined for testing out of functional_tests.py for reuse elsewhere.

This refactoring will help the creation of an API test framework.
Implement framework for testing API...

... if you can call 1 new class a framework. Includes a few test cases to exercise/drive it. These examples include a histories API test (a typical API test) and a general test of the API framework itself (mostly just the run_as functionality).

This includes changes to interactor.py to make it more useful outside the context of tool/workflow testing as well as a tweak to test Galaxy that gets started to allow testing of the run_as feature.
Add API functional tests for Kyle's page API methods.
Fix bugs in API functional test stuff.

In particular, there were substantial problems in the 'requests' compatibility layer that only gets used if requests is not available (I had loaded in my testing).