Refactoring Utils

This removes duplication regarding the `calculateIndent` function, adds missing docblocks, and adds tests for the `calculateIndent` function too.
I am not talking about how it works, but how I think it would work after reading it's name...

And I dont't even need to pass a whitespace token here...