3782: load only 1 MB of job logs
3782: restore default of no maxbytes

Use the 'size' query parameter to specify the limit of log bytes to
display for a job.  If no 'size' parameter is present, the FileStreamer
class reads up to 2**16 bytes from the API server.
3782: print log lines compatible with the log viewer

When the log is truncated, make it parsable by the log viewer regex in
addToLogViewer().
3782: keep log viewer code in _show_log.html.erb

Keep log-related restrictions in the log viewer and not in general
purpose workbench code:

* Add Rails.configuration.log_viewer_max_bytes to specify the maximum
  number of log bytes to display
* The log viewer specifies a byte limit via the HTTP Range header. The
  Content-Length of the response is set to the minimum of the 'size'
  query parameter and the byte range. If the log appears to have been
  truncated, the viewer reports it in the 'log_viewer_overview' pane.
* CollectionsController.FileStreamer either delivers the entire file
  or exactly opts[:maxbytes] bytes, whichever comes first.  It does not
  add any log-specific message.
3782: check for Content-Range header in response

Change the logic for detecting whether the log has been truncated to:
* response status code is 206
* a Content-Range header is present with 'bytes 0-x/y'
* x + 1 < y

Add a "download full log" link that is present when the full log is
available to be viewed.
3782: bugfix and added integration test

* Fixed bug where log viewer would always request partial log and receive
  206, even when total log size is shorter than log_viewer_max_bytes.
* Added integration tests:
** set up KEEP_LOCAL_STORE with dummy log
** test retrieving full job log
** test retrieving partial job log
Merge branch 'master' into 3782-large-job-logs

Conflicts:
	services/api/test/fixtures/collections.yml
	services/api/test/fixtures/jobs.yml
3782: added state to job fixture
3782: code review feedback

* Fixed whitespace, JavaScript style in _show_log.html.erb
* Removed unused bytecount variable from file_enumerator
* Changed the new job and collection fixtures to have the job uuid match
  the uuid listed in the log.
3782: fix FuseSharedTest
Merge branch '3782-large-job-logs'

Closes #3782.