Refactoring Utils

This removes duplication regarding the `calculateIndent` function, adds missing docblocks, and adds tests for the `calculateIndent` function too.
Hmmm, got no idea what I meant by that. I suspect I re-wrote part of the description, and didn't read it back to myself. I'll rewrite this:

```
Split a multi-line string up into an array of strings.
```