Proper serialization for Behat events.

Follow-up for this issue https://github.com/Behat/MinkExtension/pull/88 with (hopefully) proper solution.