Refactored utils
minor #904 Refactoring Utils (GrahamCampbell)

This PR was merged into the 1.5 branch.

Discussion
----------

Refactoring Utils

This removes duplication regarding the `calculateIndent` function, adds missing docblocks, and adds tests for the `calculateIndent` function too.

Commits
-------

e1740dd Refactored utils