Refactoring Utils

This removes duplication regarding the `calculateIndent` function, adds missing docblocks, and adds tests for the `calculateIndent` function too.
Yeah, but I would move it there anyway ;)
That why "BTW" part ;)
just need to be merged and then we could move it, if we agreed about it.