Clarify the related agents code by naming the date handling method.
Generalise related agents code to let us model relationships that have directions.
Change the way we store relationship directions so it works for non-global records too.

Previous we would store 'relationship_target', which was the URI of the
record that a relationship pointed to.  This worked fine for global
records, but could be troublesome for repository-level records, as these
can have different URIs over their lifetime if transferred between
repositories.

Now we store a pair instead: the record type and its ID.  This should be
stable throughout a record's lifetime.
Change the new directional relationship API to be a drop-in replacement for define_relationship
Add backend implementation of hasPart/isPartOf
Add support for the bound_with relationship too
Switch both relationship types to use the same JSON property
Frontend changes to support the new types of accession interrelationships.
Make sure related accessions don't interfere with spawning resources.
Code review suggestion: use the display string when showing related accessions in the read-only view.
Merge pull request #769 from hudmol/accession-to-accession-relationships

Accession to accession relationships
Move Import Jobs and Reports under the repository menu to allow more room for the advanced search
Port the public advanced search behaviour to the staff frontend
Allow advance search field rows to be added and removed
Make addition of advanced search button to the search input comply with the proper bootstrap input-append DOM structure

Also add I18n'd titles to the search buttons in the navbar.
Fix staff advanced search when more than two queries
Fix bug in public advanced search where exception is raised when building the advanced_query when more than 2 fields are provided.
Introduce staff_field_query schema to override the values listed for the field enum in the staff interface. Both the field_query (public interface) and staff_field_query (staff interface) now refer to their own dynamic enum when populating the field lists
Introduce Selenium tests for the advanced search interface.

Use SecureRandom when generating unique strings for test data as time and processid was not always unique.

When checking if an element is not present, if it is in the DOM it should be hidden.
Move FrontendEnumSource into common so it can be shared with both the staff and public Rails apps; Fix an exception in the public app where it had no enum_source specified