Document and beautify code
Minor docstring tweaks
Document code and catch recursion leaks