Restoring coverage for projects using require.js

This fixes Issue #220, but there may be a better way. This worked for my setup but as you can see I had to remove some recent edits to the file (that broke my setup), so this is probably breaking some setups while fixing others.