Websocket event testing page.
Proof of concept echo server based on rack middleware that hijacks websocket connections.
Added code to properly initialize EventMachine to deal with Passenger forking.
Added postgres NOTIFY to ArvadosModel#log_change
Added postgres LISTEN to background thread, which posts a message to the websocket.
Notification works!
Moved application-specific code out from rack_socket to lib/eventbus.rb
Moves API token authentication from ApplicationController into ArvadosApiToken Rack middleware.
Rearranges rack middleware stack a bit to accomodate.
Added permission checking to event bus so that it only report changes for
objects that the user has current read permission.
Added websocketUrl to discovery document.  Workbench websockets testing page
now uses endpoint from discovery discovery document.  Also added
ARVADOS_WEBSOCKETS environment variable.  If set, server will accept websocket
connections only and do not pass on any other type of requests.
Refactored load_filters_param and apply_where_limit_order_params into lib/
directory so that EventBus can use them.  Started adding filtering to EventBus, this is incomplete.
- Added object_owner_uuid to logs table, which records the owner of the object
  being described at the time of the log entry.  Added migration.

- Added special case permission checks for reading logs table, and added
  documentation comments on how permission checks work.

- Eventbus reuses readable_by and record_filters in determining what to publish
  so provide consistent behavior between eventbus and regular API queries.

- Put most of apply_where_limit_order_params back into application_controller,
  refactored record_filters into lib/

- All of this still needs testing.
Test helper now users ArvadosApiToken rack middleware to set current user.
Merge remote-tracking branch 'origin/master' into origin-2608-websocket-event-bus-alt2
Merge branch 'master' into origin-2608-websocket-event-bus-alt2
Added teardown to all tests which resets Thread.current[:user] and friends to
nil.  Fixed one faulty test that turned up as a result of this change.
Fixed bug whereby readable_by could return duplicate rows if there is more than
one permission granting the ability to read the row.
Reorganized readable_by query a bit to make it easier to follow.
Added test for ownership and permission links when reading entries in the logs table.
Added test runner for websocket tests.  Requires passenger standalone to be
installed.
Added websocket first tests for connecting and checking API token.
Websocket tests now use database cleaner instead of ActiveRecord's
transactional fixtures because the transaction needs to commit in order for
NOTIFY/LISTEN to work.  Fixed 'log' -> 'logs' table names in eventbus.rb.
First test for publishing an actual database change works.
Wrapped channel callback in exception handler.
Added tests, especially for error handling behavior.  Fixed bugs found by tests.
Merge remote-tracking branch 'origin/master' into origin-2608-websocket-event-bus-alt2

Conflicts:
	services/api/app/controllers/application_controller.rb
	services/api/db/schema.rb
	services/api/test/test_helper.rb