first somewhat working version
added: libc abstraction for later unit testing
added: trace class