Now preserves indentation making output code much easier to read. Also more tests.