Add debug printout for host code
Refactor SLR handling (move to separate file)