Refactored output module and output tests. Only exposed methods needed.