Added tests, fixed indentation rendering bugs
Implemented indent function, slightly restructured nesting logic.