Hook up istanbul for code coverage metrics.

When running instrumented code Function.toString()/Function.toSource()
is no longer reliable, since it returns the instrumented version of the
source instead of the original source.  Instead use/abuse the 'text'
plugin for requirejs to store the original source code for the module.
In interpreted contexts or during startup, the source arguments to the
module is undefined, so in those cases we still use toString/toSource.

'npm test --coverage' will now run the tests under istanbul and generate
code coverage information in coverage/.