Remove dev dependencies and scripts.
Clean up debugging, error checks, and add events.