From courtroom drama to a shock exit, the campaigns have been another remarkable ride for American democracy