add get_security_file() function to utils.path

This makes it easier for third party tools to retrieve security files
(e.g. json connection files) by name and [optional] profile name alone, without
knowledge of IPython's directory structure.

For example, whenever ipkernel outputs:

` --existing kernel-12345.json --profile foo`

that file can be found with:

get_security_file('kernel-12345.json', profile='foo')
cleanup pass on qtconsoleap per review

principally adding big docstring to complicated init_ssh method
add IPython.lib.kernel

get_connection_info and connect_qtconsole are now implemented as library functions
in the new module.  The zmqshell magics that call them are now simple wrappers.
split QtConsole.init_ssh into generic tunnel_to_kernel

added to new IPython.lib.kernel with other kernel connection utilities.
split qtconsole's connection-file search into lib.kernel

* fileglob-based searching for connection file added as
  IPython.lib.kernel.find_connection_file()

* also use this search in other lib.kernel methods, to make them
  more useful when run outside an IPython kernel.
Warn user if MathJax can't be fetched from notebook

	closes #744
Merge PR #847 (connection files)

* JSON connection files are now used to connect files
* HMAC message signing is now on by default in all IPython apps
* Adds IPython.lib.kernel, which contains utility functions for connecting
  clients. These were mostly copied out of qtconsoleapp in order to be
  more general.
* Adds %connection_info and %qtconsole magics to zmqshell

closes gh-688
closes gh-806
closes gh-691
fix missing trailing comma in kernel.js
BUG: Completion widget position and pager focus.

When the console widget is used with gui-completion, the positioning of
the completion widget was incorrect the first time a completion was
performed since the size of the widget is initially bogus.  Using
sizeHint fixes this.  If the paging mode is set to vsplit/hsplit, the
focus was lost after the pager is quit.
promote aliases and flags, to ensure they have priority over config files

add Application.flatten_flags() method, which adjusts the alias
and flag dicts, such that they point to the subclass in the Application.classes list when passed to the argv parser.

This prevents TerminalInteractiveShell.colors in a config file overriding
`--colors` on the command-line, which points to InteractiveShell.colors.

Flattening is only done when the answer is unambiguous, so multiply inherited classes (e.g. Launchers in ipcluster) are not touched.

also remove now-obsolete manual workaround for this in IPClusterStart

closes gh-849
Add -m option to %run to launch a module as a script.

The new -m option searches for a module on the python path and launches
that module as a script.  This is similar to Python's -m command-line
flag in behavior, but while staying inside IPython.

Conflicts:
	IPython/core/magic.py

Closes gh-819.
Merge pull request #861 from djv/master

Add support for terminating `%cpaste` blocks with `Ctrl-D`.

Closes gh-56.
fix kernel connection messsage with non-default profile

printing the connection message would crash the kernel, due to a typo

closes gh-871
IPython-specific changes to CodeMirror: recognize '?' in Python mode.
Add a README with version and ipython-specific changes info.
Add MANIFEST to ignore list.
Matjax Warning message improvement.

	merge '<script>' balises.
	Improve message text and style.
	Remove instead of hide
Hide warning message about matjax when page load

	also fix Matjax->MathJax
protect kernelapp/qtconsole from invalid connection files

(clean error/exit, rather than crash)

also use stdlib json to load connection file, not zmq.jsonapi, which can be
jsonlib2, which will return Longs, causing TraitError.
Merge pull request #850 from fperez/codemirror

Update codemirror to 2.15 and make the code internally more version-agnostic.

Added our own README file with information about what changes we carry to upstream CodeMirror and what version we currently use.