fixes #4776 - support session[:expires_at] for api requests

There are situations where the UI needs to invoke requests
on the API controllers; therefore, we need to ensure that
the session expiration accounts for them.  This is a common
for plugins, such as Katello, which leverage the
APIs extensively to support both the web UI and CLI.

With these changes, if an API request is received with
session[:expires_at], it will be evaluated and updated by the
server.  This will be the case for requests from the web-UI.

If an API request is received without session[:expires_at],
no evaluation or updating of an expiration timer will
be performed.  This latter case is the existing behavior
for the API requests (e.g via API or CLI) and will continue
to be supported.
Fixes #4884 : remove duplicate slashes from the gravatar url

The issue is that request.protocol returns http:// instead of http. The code assumed no trailing slashes
Fixes #4679 - Downcase fqdn to match Puppet SSL certs casing
fixes #1804 - find hosts through nested hostgroups on puppet class search
refs #2189 - update host group parameter search tests
Fixes #4927 - Extend foreman-debug to look for extensions provided by plugins.

This assumes a directory called /usr/share/foreman/script/foreman-debug.d.
Any *.sh file in there is sourced. The expectation is that plugins would put
files into this locations and can add files or commands as necessary
fixes #4800 SLES special handling in facts parser
fixes #4731 - Rails 3.2.8 causing _pkey constraint errors
Fixes #4851: a SmartProxy.with_features scope replaces feature-specific scopes generated during class loading
fixes #4659 - added foreman-tail tool
fixes #4691 - add search for hosts' managed status
fixes #4673 - make default sort order descending on count columns
fixes #4712 - editing organization gives undefined method parent_taxonomy_selected_location_path
fixes #3946 Set host URLs from local settings file, if no Facter configuration exists. Add default values for settings example.
fixes #1966 - improved UI errors for proxy
fixes #1809 - foreman realm integration
i18n - extracting new, updating rails, pulling from tx
Fixes #4976 - ensure the process is really running inside a rake task
fixes #4995 - editing location with 'all users' checked fails on edit page in postgres
fixes #4462 - extending the /users/login handling to process REMOTE_USER through intercept