Modify trace api

@mortenvp I finished the unit tests and fixed the todos as good as i could. Please let me know what you think? :)
Yes is saw that, but I actaullay wanted to ask you why we are writing to cout in the tests?