PHPUnit setup for test cases and some StringUtils fixes