introduce sink and source abstract interface

This is part one refactoring to make it possible to send the
output to a different sink type than a file.

Signed-off-by: Olivier Langlois <olivier@trillion01.com>