Refactoring Utils

This removes duplication regarding the `calculateIndent` function, adds missing docblocks, and adds tests for the `calculateIndent` function too.
calculate indent means to me that I have some content, which is indented, and I need to calculate what the Indent is.
So if I have `____$bar = 1;_` content it will returns me `____`.
But it gives me only `_`.