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.
Flush out API interactor...
... this will enable functional testing of API.
Eliminate interactor dependency on deprecated global variable.
Lessens the need to import things in a specific order - as long as database context is run before interactor methods everything should be fine now. TODO: Eliminate rest of dependencies on this variable.
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.