Refactoring Utils

This removes duplication regarding the `calculateIndent` function, adds missing docblocks, and adds tests for the `calculateIndent` function too.
How's this then?

```php
public static function calculateTrailingWhitespaceIndent(Token $token)
{
    if (!$token->isWhitespace()) {
        throw new InvalidArgumentException('The given token must be whitespace.');
    }

    return return ltrim(strrchr(str_replace(array("\r\n", "\r"), "\n", $token->getContent()), 10), "\n");
}
```