Major refactor

The method used to convert session messages into a browser cookie has changed.
Now all session messages added to the messages blocks are re-added to the core session message store.
Just prior to sending the response the core message store is read and deleted and used to create cookies.
This allow late handling of messages and prevents session message loss.
It also allows extension of the code to handle cacheable vs. non-cacheable responses differently