Optimal Time-Inconsistent Beliefs: Misplanning, Procrastination, and Commitment