Add a parent/child relationship to the run model.

This is to allow for spawning sweeps from a run and keeping a link between the
original run (parent) and the sweep runs (children).

Parents must have an older (lower) id than their children and the relationships
must be acyclic.
Add a method to find the root ancestor of a run.

This is so that we can find inputs and interactions that we need when the run is
a child of another run.
Add methods to create runs from a parent run.

The signatures of Run.new_from_run and Run.create_from_run match those of
ActiveRecord::Base.new and ActiveResource::Base.create, respectively, except
that they accept an extra required parameter which is the run from which the new
ones will be created.
Populate missing run inputs from its parent.

Now we can initialize a run from a parent and only pass in the inputs we want to
change.
Add Run#has_parent? method for convenience.
[TAV-366] Reuse parent run interaction replies.

If a run has a parent then it will re-use the parent interaction replies instead
of waiting for user input.
Merge branch 'rh/reuse-ints'

* rh/reuse-ints:
  [TAV-366] Reuse parent run interaction replies.
  Add Run#has_parent? method for convenience.
  Populate missing run inputs from its parent.
  Add methods to create runs from a parent run.
  Add a method to find the root ancestor of a run.
  Add a parent/child relationship to the run model.
[TAV-394] Order input/output ports consistently.

Now done alphabetically, A-Z, case insensitive.
Move child run initialization into a callback.

This removes the need for special methods to create child runs; just pass in a
parent when creating it.
Fix sample view so that only input file or value shown.
Minor additions for simple Scratchpads integration.

This is just a demo of what to do in the views to pre-set inputs via the URI
parameters.

Compare new.html.erb to embedded/new.html.erb for details.
Merge branch 'rh/scratchpads'

* rh/scratchpads:
  Minor additions for simple Scratchpads integration.
[TAV-397] Add max_attempts method to the worker.

This is set to 1 so that each run is only tried once. Setting this within the
worker itself ensures that it will only be run once even if there are other jobs
within the main app that can be re-tried multiple times.
[TAV-399] Add generator to install delayed_job script.

This isn't picked up from within the gem when Player is installed in another
rails app so need to copy it manually like this.
[TAV-403] Fix input truncation in mySQL.
[TAV-377] Output JSON for the runs controller.

This is for integration with other systems, such as Scratchpads.
Set workflow_id up properly in RunsController#new.

This wasn't being set before being passed on, which is OK for a web form, but
breaks the flow for JSON, etc.

Views also updated to reflect this change.
Move new run parameter initialization to a before filter.

This gives us a proper skinny controller.
[TAV-377] Output JSON for the runs controller.

Now get responses from new and create.
Use responds_to/responds_with in runs controller.

Much more "rails 3"; much cleaner for the different responses required by html
and json.