Update widget serializer/unserializer to allow custom serialization on a trait-by-trait basis.

Serializers/unserializers are given as the trait metadata keys `to_json` and `from_json`.
Give subclasses of the Instance traitlet the option of overriding the klass variable to have a default klass.

This makes it easy to construct traitlets for specific object types and default metadata.  For example, we can have a traitlet for numpy arrays that gives default values for `to_json` and `from_json`:

```python
def np_to_list(a):
    if a is not None:
        return a.tolist()
def np_from_list(a):
    if a is not None:
        return np.array(a)

class NDArray(Instance):
    klass = np.ndarray
    metadata = {'to_json': np_to_list,
                'from_json': np_from_list}
```

Then the NDArray traitlet will by default have the klass and some custom metadata.
Prepend a sentinel value to model ids to distinguish them from normal UUIDs (from Sylvain Corlay).
Change serialization terminology to serialize/deserialize
once-displayed
unnecessary context variable specify
incorrect comment
Simplify the code for picking json serialization functions to expose the logic better
Tests for the default klass attribute of the Instance traitlet
Change serialize/deserialize to to_json/from_json
renaming once_displayed into after_displayed
Merge pull request #6128 from jasongrout/widget-trait-serialization

Widget trait serialization
Merge pull request #6168 from SylvainCorlay/once-displayed

once-displayed
Close handle on new temporary files before returning filename

On Windows, a file can only have one open writable handle at a time, so
we need to close the one created by mkstemp before anything else can use
that file.

Closes gh-5946
add some debugging output to js tests

- display errors in evaluate / browser code
- capture and display console.log if a test fails (like nose)
fix interrupt test revealed by new output

the shortcut test wasn’t running at all,
due to a ReferenceError.

There was no indication of this fact
because javascript is awesome like that.
Merge pull request #6195 from takluyver/i5946

Close handle on new temporary files before returning filename
Merge pull request #6144 from minrk/show-js-errors

add some debugging output to js tests