How supernovae are helping uncover the mysteries of dark energy