I've had these all my life. Sometimes I thought I had an alien about to burst out. You must wonder though if it was the actual forfeit of one of Life's Allowable Pleasures or your change in attitude that made them go away. For whatever reason I haven't had one in years.
But it's possible caffiene was your source, everyone's body is different. My wife is sensitive to the slightest changes, from coffee to alcohol, mine is the cast iron mack truck of biosystems. I can take or leave the coffee, no effect either way other than I love the stuff. :-)