Logger refactor

Logger now uses streambufs instead of hacky ostream pointers.