removed many includes from header

* std::ostream now reference instead of pointer
[wip] improve buffered output