Tool functional tests - refactor reusable function for verifing output

... from verify_dataset_correctness. Introduce simple, extensible abstraction for fetching outputs for verification in twilltestcase.py. Will want to reuse the core verification of the displayed dataset in the API driven case and will not need or be able to use the extra cruft related to checking UI, job state, etc...

Also small twilltestcase code structure updates for Python 2.6+.
Outline new API based galaxy interactor for functional tests.

Add mechanism to tool test parser code to determine which Galaxy interactor should be used ('twill' or 'api' are current options). This maybe a stop gap to force usage of the API interactor until that becomes the default or may prove in the long term to be essential if there are certain tools that will always require Twill-specific functionality or if new browser-based JavaScript (e.g. w/selenium) are implemented. An interactor value can be specified at the tests level and/or at the level of individual test elements in the tool XML (using the 'interactor' attribute on either element).

The current default interactor is 'twill'. The default interactor app-wide can be overridden with the GALAXY_TEST_DEFAULT_INTERACTOR environment variable.
Twill-less tool tests initial implementation.

Implement GalaxyInteractorApi, is working for simple tests.

Lots left to do likely - conditionals, repeats, composite uploads, pages(?).

Introduces dependency on Python requests package - subsequent changeset will provide urllib2 based fallback if requests unavailable.
Twill-less tool tests - allow tests with GALAXY_TEST_EXTERNAL...

... if GALAXY_TEST_EXTERNAL is ever fixed.
Move test_toolbox's expand_grouping out into tool/test.py.

Will be merged with related tree code already in test.py in a subsequent changeset.
Simplify logic in tool test expand_grouping.
Tool functional tests - all unspecified default conditional values.

Fix should apply to both twill and API variants. For now just grabbing first option in select list, a subsequent changeset adds much richer options including handling of booleans and options labeled as default.
Twill-less tool tests - handle repeats and conditionals.

Expand 'inputs' tree when building tool inputs for API functional tests.

Code is in there for both flat inputs (the way the UI would submit them), and a nested tree structure. The nested tree structure will not work with the Galaxy API currently - but it is the way the API should work :).
Twill-less tool tests fix for nested input filenames.
Twill-less tool tests fix for tests with html outputs.

For example gatk_analyze_covariates.
Twill-less tool tests fix for binary data in results.

Use requests' response.content instead of response.text for reading results.

Fixes the following error 'UnicodeEncodeError: 'ascii' codec can't encode characters in position 1-3: ordinal not in range(128)' when dealing with ASN.1 binary files.
Twill-less tool tests - enhancements related to errors.

 - Report formatted standard error and standard output of tools like Twill interactor.
 - Respect testdef.maxseconds to timeout test cases.
 - Check history item - like Twill interactor do not verify 'error' datasets.
 - Properly raise exceptions with reported API error messages when running tools.
Add new option, tools, and data to functional test framework to test/demonstrate tool framework itself.

Add smaple repeat tool demonstrating some weaknesses of twill-based current framework.
Twill-less tool tests - allow multiple param instances with same name.

Allows specifing multiple repeat instances.
Tool functional tests - allow disambiguation of params in conditionals.

Disambiguate by add prefix for parent (or any number of direct ancestors) with pipe (|). See included test case for an example.

Should fix twill and API driven functional tests.
Twill-less tool tests - handle composite inputs.

Add example tool test for composite data (worked with Twill based test framework prior to this commit, works with API based framework as a result of this commit).
Add more sample tools for tool testing framework.

Adding multi_select.xml, which demonstrates twill cannot deal with - at the beginning of select param values - this test works immediately with API interactor.

Also adding a multi_output.xml, this is a tool using variable number of outputs (force_refresh=True), both interactors pass this but it is a good test to verify that.

Also adding example to test multi-page tools (multi_page.xml) - both interactors pass this test. Though the API needed to be adjusted to allow its use (in a previous changeset).

Also adding example tool demonstrating extra_files output.

Finally, a tool simple_constructs.xml that just tests the basics, various parameter types, simple conditional, and simple repeat.
Provide fallback implementation of requests  functionality if lib unavailable.

Just limited post/get functionality needed for tests.
Twill-less tool tests - handle input metadata tags.
Tool functional tests - allow checking extra files without checking a primary file.

For output datatypes where primary file is meaningless.