Refactored debug module, added all missing docs