base class for view listeners

The main task of serializing the controller results is done in a base
class. Concrete listeners just implement two small methods to check if
they are capable to handle a certain controller result and then serialize
the result.