only strip continuation prompts if regular prompts seen first

should be discussed before merge (ping @takluyver),
as it is a significant and sensitive change.

I'm also not sure that it's the right fix, but worth a try.

closes #4059
store default codemirror mode in only 1 place
do not include specific css in embedable one
catch if cm_config of other key undefined
cleanup Client.close

allows setting `linger` on sockets at shutdown time.
close Client sockets if connection fails

avoids runaway FDs in cases of frequent client failure.
Implement a better check for hidden values for %who etc.
Tweaks to interactiveshell for user_ns_hidden as dict
FIXED, nbconvert sphinx preprocessor date format string for Windows
Adding citation support.
FIX, coalescestreams incorrect nesting.
Adding better logic to the PDF postprocessor.
Adding docs about latex citations.
FIX: nbconvert unicode html header characters (Win + Py2.x)
Fixing review comments:

* Don't use lstrip/rstrip in that way.
* Renaming things in the pdf postprocessor.
move `--profile-dir` alias to base IPython app

allows specifying exact path to profile directory,
rather than just the name.
remember argv used to initialize an Application

store a copy so it can't be manipulated
pass profile-dir instead of profile to Kernel

avoids relative path issues for local profiles
when the notebook server starts in a different directory
from the kernels.
Add way to install MathJax to a particular profile
Make profile not set a default