Extend js error logging to display build number and error type

This gives us more detailed logging of js errors from the diagnostics box.

Next step: visualise the logged javascript errors in admin.