Javascript utility to dynamically track and report errors in pages