Changed formatters so that they don't directly print to console but return a string with their generated output. This is to allow unit testing.
Created unit tests for testing formatters' output. These tests do not thoroughly validate this feature.