Improve performance of Resource.run()
Document events and callbacks with JSDoc.