Refactoring Utils

This removes duplication regarding the `calculateIndent` function, adds missing docblocks, and adds tests for the `calculateIndent` function too.
Thanks. Will fix shortly. I'm currently working on writing tests for the annotation class in the phpdoc pull.