Make it Symfony 2.2 friendly, use json for transfer to client

Hi. I don't understand why base64 is used, because json is much easier to use. Also I made FlashMessageListener Symfony 2.2 friendly.