Properly mock winreg functions for test

Fixes a lot of test failures on Python 3.4 on Windows, caused by
importlib trying to use our mocked out winreg functions when
reload(path) was called.
Merge pull request #6581 from ipython/mock-winreg-tests

Properly mock winreg functions for test
Fix ReferenceError in js tests, fixes #6542
Merge pull request #6584 from jhamrick/fix-js-tests

Fix ReferenceError in js tests