[vector-api] ol.format.Format#write*AsString

This PR adds methods to the core `ol.format.Format` base classes (`ol.format.JSON`, `ol.format.Text`, `ol.format,XML`) to write to strings.