Implement new context and filter models

The `Filter` model represents a single context node that is arbitrarily
complex. It is bound to a concept, field, or concept-field. Filters are
managed by the `Filters` collection which is a flat container. It
handles serializing the context nodes into a representation supported by
the server.

Includes update to Backbone 1.1.2

The context node API was a blocker for upgrading due to the changed
behavior of looking up models by id in collections.

One noteable change is that URLs are no longer bound to to model or
collections during initialization.

This version also has native AMD support.

Fix #318, #328, #467

Signed-off-by: Byron Ruth <b@devel.io>
Add foundation for control-based validation

This simply adds a `validate` method to controls that can be implemented
to take bare attributes and returns an error message if validation
fails. This behaves the same as Backbone.Model validation.

A few JavaScript ports of various controls are included as well.

Fix #340

Signed-off-by: Byron Ruth <b@devel.io>
Replace concept-level form controls with field controls

Each field now has it's own set of apply/update button to remove the
ambiguity when applying a filter. This relies on the new context filters
API and uses the filter node directly. The context is still available
for performing checks between the applied and "working" filter states.

Control validation has been integrated to make validation and diffing
the states easier to use.

Fix #498, #448

Signed-off-by: Byron Ruth <b@devel.io>
Fix various typos and comments from code review

Signed-off-by: Byron Ruth <b@devel.io>
Migrate remaining Backbone.View subclass to Marionette.View

Backbone 1.1+ no long binds the options passed in to views on the view
itself (like models). Marionette maintains this behavior, so all existing
views have been changed to subclass from Marionette.View.

Signed-off-by: Byron Ruth <b@devel.io>
Port remaining workflow views to JavaScript

Signed-off-by: Byron Ruth <b@devel.io>
Remove embedded query dialogs from QueryList view

Fix #475

Signed-off-by: Byron Ruth <b@devel.io>
Move context filers parsing into 'json' change handler

This ensures that no matter how the json attributes are set on the
context, the filters state is updated.

This fix restores the ability to update the session context with
and existing saved query.

Signed-off-by: Byron Ruth <b@devel.io>
Ensure the filter state is hidden on re-render

This prevents the case when a filter is updated and invalid and then
removed.

Signed-off-by: Byron Ruth <b@devel.io>
Fix context panel message based on current route

Signed-off-by: Byron Ruth <b@devel.io>
Force applied filters to be enabled

This prevents the case that an existing filter that is disabled gets
updated, but has no upstream effect since it's disabled. In addition,
the  attribute is stripped to prevent using and old attribute.

As noted in the comment, a better method for cleaning the attributes
prior to being applied should be implemented.

Signed-off-by: Byron Ruth <b@devel.io>
Refactor support for required filters

The implementation has changed to be more generic. The new configuration
option `filters.required` is an array of lookups, that is, objects
containing keys that can be used to match a filter. This is usually a
concept id, field id or both. The option `query.concepts.required` is
deprecated, but will remain until the 2.4 release.

The 'context:required' event has been deprecated in favor of using just
the 'context:invalid' event since it is more general and contains the same
information.

Signed-off-by: Byron Ruth <b@devel.io>
Revert support for concept-only filters

These are not yet supported in the UI via controls and would result
in a backwards incompatible change. The behavior has been reverted to
ensure bare concept nodes are deconstructed into their fields.

Signed-off-by: Byron Ruth <b@devel.io>
Prevent removing a filter from triggering the concept view

Signed-off-by: Byron Ruth <b@devel.io>
Merge pull request #508 from cbmi/filters

Refactor of context model and addition of filters API