Add ephemeral state preservation support to mysql

Element also needed some refactoring to work like other elements in the
collection.

Change-Id: Ie5d91f1f719cfb98dd8d10f0be2ff46b3be91e14