Javascript error catcher and event logger library