Refactor writer object

This is a .... err.... copy and paste work lol
I just move the print, and image write work into separate class. So that main and qucs can simply call these object to print the document.
I don't like the way I implement these actually, I think there is more compact implementation but I currently don't wanna think about it XDD.