Implement file output writer

Also fix config bug which caused queuesize and inputbuffersize to
be ignored.