BUG-1487: use prototypes for instantiating codecs

Optimizes the per-class overhead by copying a prototype class, and then
setting the proper serializer name. At the same time we get rid of the
static serializer methods, making the interface a bit cleaner.
Additionally, we hide the AbstractStreamWriterGenerator, so that to have
a proper boundary.

Change-Id: Ia7d56ff16e1eec7204fa087c49f2ee55a658a377
Signed-off-by: Robert Varga <rovarga@cisco.com>
BUG-1487: refactor StreamWriterGenerator

This is a reorganization of the StreamWriterGenerator such that it is
properly split up into classes, with contracts clarified. It also
prevents outside subclassing. Also cache pre-made serializer instances.

Change-Id: I492d73a082c24c03b8d17f3868e4a497c8f64b7b
Signed-off-by: Robert Varga <rovarga@cisco.com>