Cleanup and fixes to move it to a "functional" state

- Logging statements instead of prints
- Fixed issue with vars defined within for-loops or if-clauses to get
dumped in the assignments section
- Some docstrings
- Added ability to have different output methods
- Fixed docstring formatting in template
- Fixed variable value formatting