Library - step one

- Moved debug & fatal functions to separate struct. context settings not
good (caused issues with xds)