Separated printer functionality into separate module.
Added printer tests.