Allow using different input and output formats.

Please pull.